| Conditions | 2 |
| Paths | 2 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 15 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 58 | protected function getAnchor($value) |
||
| 59 | { |
||
| 60 | 1 | $truncate = $this->truncate; |
|
| 61 | 1 | $this->truncate = NULL; |
|
| 62 | |||
| 63 | 1 | $value = parent::formatValue($value); |
|
|
|
|||
| 64 | 1 | $href = $this->formatHref($value); |
|
| 65 | 1 | $text = $this->formatText($value); |
|
| 66 | |||
| 67 | 1 | $anchor = \Nette\Utils\Html::el('a') |
|
| 68 | 1 | ->setHref($href) |
|
| 69 | 1 | ->setText($text) |
|
| 70 | 1 | ->setTarget('_blank') |
|
| 71 | 1 | ->setRel('noreferrer'); |
|
| 72 | |||
| 73 | 1 | if ($truncate) { |
|
| 74 | 1 | $anchor->setText($truncate($text)) |
|
| 75 | 1 | ->setTitle($value); |
|
| 76 | 1 | } |
|
| 77 | |||
| 78 | 1 | return $anchor; |
|
| 79 | } |
||
| 80 | } |
||
| 81 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()method in theSoncalls the wrong method in the parent class.