| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 3 |
| CRAP Score | 2.5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | 3 | public function getRulesetPathForStandardName(string $standardName) : string |
|
| 36 | { |
||
| 37 | 3 | if (isset($this->getStandards()[$standardName])) { |
|
| 38 | 3 | return $this->getStandards()[$standardName]; |
|
| 39 | } |
||
| 40 | |||
| 41 | throw new Exception( |
||
| 42 | sprintf( |
||
| 43 | 'Ruleset for standard "%s" was not found. Found standards are: %s.', |
||
| 44 | $standardName, |
||
| 45 | implode($this->getRulesetNames(), ', ') |
||
| 46 | ) |
||
| 47 | ); |
||
| 48 | } |
||
| 49 | |||
| 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.