| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 53 | 5 | public function getStandards() : array |
|
| 54 | { |
||
| 55 | 5 | if ($this->rulesets) { |
|
|
|
|||
| 56 | 4 | return $this->rulesets; |
|
| 57 | } |
||
| 58 | |||
| 59 | 5 | foreach ($this->findRulesetFiles() as $rulesetFile) { |
|
| 60 | 5 | $rulesetXml = simplexml_load_file($rulesetFile); |
|
| 61 | |||
| 62 | 5 | $rulesetName = (string) $rulesetXml['name']; |
|
| 63 | 5 | $this->rulesets[$rulesetName] = $rulesetFile; |
|
| 64 | } |
||
| 65 | |||
| 66 | 5 | return $this->rulesets; |
|
| 67 | } |
||
| 68 | |||
| 86 |
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.