| Conditions | 6 | 
| Paths | 5 | 
| Total Lines | 17 | 
| Code Lines | 9 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 0 | 
| CRAP Score | 42 | 
| Changes | 0 | ||
| 1 | <?php  | 
            ||
| 25 | public function enterBlock(Block $block)  | 
            ||
| 26 |     { | 
            ||
| 27 | $children = $block->getChildren();  | 
            ||
| 28 |         if ($children) { | 
            ||
| 
                                                                                                    
                        
                         | 
                |||
| 29 | $childrenCount = count($children);  | 
            ||
| 30 |             if ($childrenCount <= 1) { | 
            ||
| 31 | return;  | 
            ||
| 32 | }  | 
            ||
| 33 | |||
| 34 |             foreach ($children as $index => $child) { | 
            ||
| 35 | // Check that exit node is not the latest  | 
            ||
| 36 |                 if ($child->willExit() && ($index + 1) != $childrenCount) { | 
            ||
| 37 | echo 'Unreacheable block ' . $block->getId() . PHP_EOL;  | 
            ||
| 38 | }  | 
            ||
| 39 | }  | 
            ||
| 40 | }  | 
            ||
| 41 | }  | 
            ||
| 42 | |||
| 57 | 
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.