We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| 1 | <?php |
||
| 30 | final class Factory |
||
| 31 | { |
||
| 32 | /** |
||
| 33 | * @var string[] |
||
| 34 | */ |
||
| 35 | private $namespaces; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @var ReflectionClass[] |
||
| 39 | */ |
||
| 40 | private $reflections; |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @var self |
||
| 44 | */ |
||
| 45 | private static $defaultInstance; |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Initializes the rule with the defined namespaces. |
||
| 49 | * |
||
| 50 | * If the default namespace is not in the array, it will be add to the end |
||
| 51 | * of the array. |
||
| 52 | * |
||
| 53 | * @param array $namespaces |
||
| 54 | */ |
||
| 55 | 11 | public function __construct(array $namespaces = []) |
|
| 63 | |||
| 64 | /** |
||
| 65 | * Defines the default instance of the factory. |
||
| 66 | * |
||
| 67 | * @param Factory $factory |
||
| 68 | */ |
||
| 69 | 1 | public static function setDefaultInstance(self $factory) |
|
| 73 | |||
| 74 | /** |
||
| 75 | * Returns the default instance of the factory. |
||
| 76 | * |
||
| 77 | * @return self |
||
| 78 | */ |
||
| 79 | 2 | public static function getDefaultInstance(): self |
|
| 87 | |||
| 88 | /** |
||
| 89 | * Returns a list of namespaces. |
||
| 90 | * |
||
| 91 | * @return array |
||
| 92 | */ |
||
| 93 | 9 | public function getNamespaces(): array |
|
| 97 | |||
| 98 | /** |
||
| 99 | * Creates a rule based on its name with the defined arguments. |
||
| 100 | * |
||
| 101 | * @param string $ruleName |
||
| 102 | * @param array $arguments |
||
| 103 | * |
||
| 104 | * @throws ComponentException When the rule cannot be created |
||
| 105 | * |
||
| 106 | * @return Rule |
||
| 107 | */ |
||
| 108 | 6 | public function rule(string $ruleName, array $arguments = []): Rule |
|
| 131 | |||
| 132 | private function getMessage(ReflectionClass $reflection, Result $result): string |
||
| 145 | |||
| 146 | public function exception(Result $result) |
||
| 155 | |||
| 156 | private function chooseTemplate(Templates $templates, Result $result): Template |
||
| 179 | |||
| 180 | /** |
||
| 181 | * Creates a ReflectionClass object based on a class name. |
||
| 182 | * |
||
| 183 | * This method always return the same object for a given class name in order |
||
| 184 | * to improve performance. |
||
| 185 | * |
||
| 186 | * @param string $className |
||
| 187 | * |
||
| 188 | * @return ReflectionClass |
||
| 189 | */ |
||
| 190 | 5 | private function getReflection(string $className): ReflectionClass |
|
| 198 | } |
||
| 199 |
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..