| Conditions | 6 |
| Paths | 10 |
| Total Lines | 18 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public function getLinks($type = null): array |
||
| 22 | 9 | { |
|
| 23 | 6 | if (null === $this->links) { |
|
| 24 | 6 | $this->links = ExtractLinks::get($this, ExtractLinks::SELECT_A); |
|
| 25 | $this->classifyLinks(); |
||
| 26 | } |
||
| 27 | |||
| 28 | 9 | switch ($type) { |
|
| 29 | 6 | case Link::LINK_SELF: |
|
| 30 | 9 | return $this->linksPerType[Link::LINK_SELF] ?? []; |
|
| 31 | 6 | case Link::LINK_INTERNAL: |
|
| 32 | 9 | return $this->linksPerType[Link::LINK_INTERNAL] ?? []; |
|
| 33 | 6 | case Link::LINK_SUB: |
|
| 34 | 9 | return $this->linksPerType[Link::LINK_SUB] ?? []; |
|
| 35 | 6 | case Link::LINK_EXTERNAL: |
|
| 36 | return $this->linksPerType[Link::LINK_EXTERNAL] ?? []; |
||
| 37 | 9 | default: |
|
| 38 | return $this->links; |
||
| 39 | } |
||
| 66 |