Conditions | 3 |
Paths | 3 |
Total Lines | 23 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
58 | public function getType($type) |
||
59 | { |
||
60 | if (parent::hasType($type)) { |
||
|
|||
61 | return parent::getType($type); |
||
62 | } |
||
63 | |||
64 | $metadata = $this->metadataFactory->getMetadataForClass($type); |
||
65 | |||
66 | if (!$metadata) { |
||
67 | throw new \InvalidArgumentException(sprintf( |
||
68 | 'The type "%s" cannot be loaded by this extension', |
||
69 | $type |
||
70 | )); |
||
71 | } |
||
72 | |||
73 | $surrogateType = new SurrogateType( |
||
74 | $type, |
||
75 | $this->fieldRegistry, |
||
76 | $metadata |
||
77 | ); |
||
78 | |||
79 | return $surrogateType; |
||
80 | } |
||
81 | } |
||
82 |
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 theSon
calls the wrong method in the parent class.