| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 7 | public function extractEvents( SubjectCollection $pages ): array { |
|
| 19 | 7 | $events = []; |
|
| 20 | |||
| 21 | 7 | foreach ( $pages->getSubjects() as $subject ) { |
|
| 22 | 5 | [ $startDate, $endDate ] = $this->getDates( $subject ); |
|
| 23 | |||
| 24 | 5 | if ( $startDate !== null ) { |
|
| 25 | 4 | $events[] = new Event( $subject, $startDate, $endDate ); |
|
| 26 | } |
||
| 27 | } |
||
| 28 | |||
| 29 | 7 | return $events; |
|
| 30 | } |
||
| 31 | |||
| 67 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.