| Conditions | 2 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 62 | public function reverseTransform($idObject) |
||
| 63 | { |
||
| 64 | $identifier = current(array_values($this->om->getClassMetadata($this->entityName)->getIdentifier())); |
||
| 65 | |||
| 66 | $object = $this->om |
||
| 67 | ->getRepository($this->entityName) |
||
| 68 | ->findOneBy([$identifier => $idObject]); |
||
| 69 | |||
| 70 | if (null === $object) { |
||
| 71 | throw new TransformationFailedException( |
||
| 72 | sprintf( |
||
| 73 | 'An object with identifier key "%s" and value "%s" does not exist!', |
||
| 74 | $identifier, |
||
| 75 | $idObject |
||
| 76 | ) |
||
| 77 | ); |
||
| 78 | } |
||
| 79 | |||
| 80 | return $object; |
||
| 81 | } |
||
| 82 | } |
||
|
|
|||
| 83 |
This check marks files that end in a newline character, i.e. an empy line.