| Conditions | 6 | 
| Paths | 3 | 
| Total Lines | 12 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | <?php | ||
| 52 | protected function getCwYear(\DateTime $date) | ||
| 53 |     { | ||
| 54 |         $year = (int)$date->format('Y'); | ||
| 55 |         if ($date->format('m') === '01' && ($date->format('W') === '52' || $date->format('W') === '53')) { | ||
| 56 | $year--; | ||
| 57 |         } else { | ||
| 58 |             if ($date->format('m') === '12' && $date->format('W') === '01') { | ||
| 59 | $year++; | ||
| 60 | } | ||
| 61 | } | ||
| 62 | return $year; | ||
| 63 | } | ||
| 64 | } | ||
| 65 | 
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.