| 1 | <?php |
||
| 11 | class IdentifierToObjectTransformer extends ObjectToIdentifierTransformer |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Repository. |
||
| 15 | * |
||
| 16 | * @var ObjectRepository |
||
| 17 | */ |
||
| 18 | protected $repository; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Identifier. |
||
| 22 | * |
||
| 23 | * @var string |
||
| 24 | */ |
||
| 25 | protected $identifier; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Constructor. |
||
| 29 | * |
||
| 30 | * @param ObjectRepository $repository |
||
| 31 | * @param string $identifier |
||
| 32 | */ |
||
| 33 | public function __construct(ObjectRepository $repository, $identifier = 'id') |
||
| 38 | |||
| 39 | /** |
||
| 40 | * {@inheritdoc} |
||
| 41 | */ |
||
| 42 | public function reverseTransform($value) |
||
| 46 | |||
| 47 | /** |
||
| 48 | * {@inheritdoc} |
||
| 49 | */ |
||
| 50 | public function transform($value) |
||
| 54 | } |
||
| 55 |
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.