We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| 1 | <?php |
||
| 31 | 5 | final class Factory |
|
| 32 | { |
||
| 33 | /** |
||
| 34 | 3 | * @var string[] |
|
| 35 | */ |
||
| 36 | 3 | private $namespaces; |
|
| 37 | 3 | ||
| 38 | /** |
||
| 39 | 2 | * @var ReflectionClass[] |
|
| 40 | */ |
||
| 41 | 2 | private $reflections; |
|
| 42 | 2 | ||
| 43 | /** |
||
| 44 | 6 | * @var self |
|
| 45 | */ |
||
| 46 | 6 | private static $defaultInstance; |
|
| 47 | |||
| 48 | /** |
||
| 49 | * Initializes the rule with the defined namespaces. |
||
| 50 | 6 | * |
|
| 51 | 6 | * If the default namespace is not in the array, it will be add to the end |
|
| 52 | 6 | * of the array. |
|
| 53 | 3 | * |
|
| 54 | * @param array $namespaces |
||
| 55 | */ |
||
| 56 | 4 | public function __construct(array $namespaces = []) |
|
| 64 | 2 | ||
| 65 | /** |
||
| 66 | * Defines the default instance of the factory. |
||
| 67 | * |
||
| 68 | * @param Factory $factory |
||
| 69 | */ |
||
| 70 | public static function setDefaultInstance(self $factory) |
||
| 74 | |||
| 75 | /** |
||
| 76 | * Returns the default instance of the factory. |
||
| 77 | * |
||
| 78 | * @return self |
||
| 79 | */ |
||
| 80 | public static function getDefaultInstance(): self |
||
| 88 | |||
| 89 | /** |
||
| 90 | * Returns a list of namespaces. |
||
| 91 | * |
||
| 92 | * @return array |
||
| 93 | */ |
||
| 94 | public function getNamespaces(): array |
||
| 98 | |||
| 99 | /** |
||
| 100 | * Creates a rule based on its name with the defined arguments. |
||
| 101 | * |
||
| 102 | * @param string $ruleName |
||
| 103 | * @param array $arguments |
||
| 104 | * |
||
| 105 | * @throws ComponentException When the rule cannot be created |
||
| 106 | * |
||
| 107 | * @return Rule |
||
| 108 | */ |
||
| 109 | public function rule(string $ruleName, array $arguments = []): Rule |
||
| 132 | |||
| 133 | private function getMessage(ReflectionClass $reflection, Result $result): string |
||
| 151 | |||
| 152 | public function exception(Result $result): ValidationException |
||
| 161 | |||
| 162 | private function chooseTemplate(Templates $templates, bool $isInverted, string $templateId): 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 | 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..