| Conditions | 5 |
| Paths | 5 |
| Total Lines | 17 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 6 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 31 | public function getEntityLabel() |
||
| 32 | { |
||
| 33 | $label = ''; |
||
| 34 | $entity = $this->getUniqueEntity(); |
||
| 35 | |||
| 36 | if (method_exists($entity, 'getLabel')) { |
||
| 37 | $label = $entity->getLabel(); |
||
| 38 | } elseif (method_exists($entity, 'getTitle')) { |
||
| 39 | $label = $entity->getTitle(); |
||
| 40 | } elseif (method_exists($entity, 'getName')) { |
||
| 41 | $label = $entity->getName(); |
||
| 42 | } elseif (method_exists($entity, '__toString')) { |
||
| 43 | $label = $entity->__toString(); |
||
| 44 | } |
||
| 45 | |||
| 46 | return $label; |
||
| 47 | } |
||
| 48 | } |
||
| 49 |