| Conditions | 3 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3.0261 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 7 | public function normalize($entity) |
|
| 30 | { |
||
| 31 | 7 | $class = get_class($entity); |
|
| 32 | 7 | $metadata = $this->registry->getManagerForClass($class)->getClassMetadata($class); |
|
| 33 | |||
| 34 | 7 | $ids = $metadata->getIdentifierValues($entity); |
|
| 35 | |||
| 36 | 7 | if (!$metadata instanceof ClassMetadata || $metadata->isIdentifierComposite) { |
|
| 37 | return $ids; |
||
| 38 | } |
||
| 39 | |||
| 40 | 7 | return array_shift($ids); |
|
| 41 | } |
||
| 42 | |||
| 66 |