We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| 1 | <?php |
||
| 26 | final class Factory |
||
| 27 | { |
||
| 28 | /** |
||
| 29 | * @var string[] |
||
| 30 | */ |
||
| 31 | private $namespaces; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @var ReflectionClass[] |
||
| 35 | */ |
||
| 36 | private $reflections; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @var self |
||
| 40 | */ |
||
| 41 | private static $defaultInstance; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Initializes the rule with the defined namespaces. |
||
| 45 | * |
||
| 46 | * If the default namespace is not in the array, it will be add to the end |
||
| 47 | * of the array. |
||
| 48 | * |
||
| 49 | * @param array $namespaces |
||
| 50 | */ |
||
| 51 | 11 | public function __construct(array $namespaces = []) |
|
| 59 | |||
| 60 | /** |
||
| 61 | * Defines the default instance of the factory. |
||
| 62 | * |
||
| 63 | * @param Factory $factory |
||
| 64 | */ |
||
| 65 | 1 | public static function setDefaultInstance(self $factory) |
|
| 69 | |||
| 70 | /** |
||
| 71 | * Returns the default instance of the factory. |
||
| 72 | * |
||
| 73 | * @return self |
||
| 74 | */ |
||
| 75 | 2 | public static function getDefaultInstance(): self |
|
| 83 | |||
| 84 | /** |
||
| 85 | * Returns a list of namespaces. |
||
| 86 | * |
||
| 87 | * @return array |
||
| 88 | */ |
||
| 89 | 9 | public function getNamespaces(): array |
|
| 93 | |||
| 94 | /** |
||
| 95 | * Creates a rule based on its name with the defined arguments. |
||
| 96 | * |
||
| 97 | * @param string $ruleName |
||
| 98 | * @param array $arguments |
||
| 99 | * |
||
| 100 | * @throws ComponentException When the rule cannot be created |
||
| 101 | * |
||
| 102 | * @return Rule |
||
| 103 | */ |
||
| 104 | 6 | public function rule(string $ruleName, array $arguments = []): Rule |
|
| 127 | |||
| 128 | /** |
||
| 129 | * Creates a ReflectionClass object based on a class name. |
||
| 130 | * |
||
| 131 | * This method always return the same object for a given class name in order |
||
| 132 | * to improve performance. |
||
| 133 | * |
||
| 134 | * @param string $className |
||
| 135 | * |
||
| 136 | * @return ReflectionClass |
||
| 137 | */ |
||
| 138 | 5 | private function getReflection(string $className): ReflectionClass |
|
| 146 | } |
||
| 147 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..