| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | public static function relations(ClassMetadata $classMetadata) |
||
| 38 | { |
||
| 39 | $encoded = json_encode($classMetadata); |
||
| 40 | $decoded = json_decode($encoded, true); |
||
| 41 | $relations = $decoded['associationMappings']; |
||
| 42 | |||
| 43 | $relMap = []; |
||
| 44 | |||
| 45 | foreach ($relations as $name => $meta) { |
||
| 46 | $relMap[$name] = $meta['targetEntity']; |
||
| 47 | } |
||
| 48 | |||
| 49 | return $relMap; |
||
| 50 | } |
||
| 65 |
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.