| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | public static function relations(ClassMetadata $classMetadata) { |
||
| 45 | $encoded = json_encode($classMetadata); |
||
| 46 | $decoded = json_decode($encoded, true); |
||
| 47 | $relations = $decoded['associationMappings']; |
||
| 48 | |||
| 49 | $relMap = []; |
||
| 50 | |||
| 51 | foreach ($relations as $name => $meta) { |
||
| 52 | $relMap[$name] = $meta['targetEntity']; |
||
| 53 | } |
||
| 54 | |||
| 55 | return $relMap; |
||
| 56 | } |
||
| 73 |
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.