Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2.351 |
Changes | 0 |
1 | <?php |
||
45 | 18 | private function initializeFrom(XMLReader $reader) |
|
46 | { |
||
47 | 18 | if ($reader->nodeType !== XMLReader::ELEMENT) { |
|
48 | $node = new Node($reader); |
||
49 | |||
50 | throw new RuntimeException(sprintf( |
||
51 | 'Reader must be at an XMLReader::ELEMENT, is XMLReader::%s given.', |
||
52 | $node->getNodeTypeName() |
||
53 | )); |
||
54 | } |
||
55 | |||
56 | 18 | $this->name_ = $reader->name; |
|
57 | 18 | $this->attributes_ = parent::getAttributes()->getArrayCopy(); |
|
|
|||
58 | 18 | } |
|
59 | } |
||
60 |
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.