The expression $this->getRulesets()[$standardName]; of type integer|string|Symplify\...ffer\FileSystem\strings adds the type Symplify\MultiCodingStan...ffer\FileSystem\strings to the return on line 41 which is incompatible with the return type declared by the interface Symplify\MultiCodingStan...esetPathForStandardName of type string.
Loading history...
42
}
43
44
1
throw new Exception(
45
sprintf(
46
1
'Ruleset for standard "%s" was not found. Found standards are: %s.',
The expression $this->rulesets of type Symplify\MultiCodingStan...er\FileSystem\strings[] is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.
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.
Loading history...
59
4
return $this->rulesets;
60
}
61
62
4
foreach ($this->findRulesetFiles() as $rulesetFile) {
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.