1 | <?php |
||
14 | final class StandardFinder |
||
15 | { |
||
16 | /** |
||
17 | * @var string[] |
||
18 | */ |
||
19 | private $rulesets = []; |
||
20 | |||
21 | /** |
||
22 | * @param string[] $names |
||
23 | * @return string[] |
||
24 | */ |
||
25 | public function getRulesetPathsForStandardNames(array $names) : array |
||
26 | { |
||
27 | $rulesetPaths = []; |
||
28 | foreach ($names as $name) { |
||
29 | $rulesetPaths[$name] = $this->getRulesetPathForStandardName($name); |
||
30 | } |
||
31 | |||
32 | return $rulesetPaths; |
||
33 | } |
||
34 | |||
35 | 2 | public function getRulesetPathForStandardName(string $standardName) : string |
|
49 | |||
50 | /** |
||
51 | * @return string[] |
||
52 | */ |
||
53 | 4 | public function getStandards() : array |
|
68 | |||
69 | /** |
||
70 | * @return string[] |
||
71 | */ |
||
72 | 4 | private function findRulesetFiles() : array |
|
80 | |||
81 | private function getRulesetNames() : array |
||
85 | } |
||
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.