We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| 1 | <?php |
||
| 31 | final class Factory |
||
| 32 | { |
||
| 33 | /** |
||
| 34 | * @var string[] |
||
| 35 | */ |
||
| 36 | private $namespaces; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @var ReflectionClass[] |
||
| 40 | */ |
||
| 41 | private $reflections; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @var Reader |
||
| 45 | */ |
||
| 46 | private $annotationReader; |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @var self |
||
| 50 | */ |
||
| 51 | private static $defaultInstance; |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Initializes the rule with the defined namespaces. |
||
| 55 | * |
||
| 56 | * If the default namespace is not in the array, it will be add to the end |
||
| 57 | * of the array. |
||
| 58 | * |
||
| 59 | * @param array $namespaces |
||
| 60 | */ |
||
| 61 | 11 | public function __construct(array $namespaces = []) |
|
| 73 | |||
| 74 | /** |
||
| 75 | * Defines the default instance of the factory. |
||
| 76 | * |
||
| 77 | * @param Factory $factory |
||
| 78 | */ |
||
| 79 | 1 | public static function setDefaultInstance(self $factory) |
|
| 83 | |||
| 84 | /** |
||
| 85 | * Returns the default instance of the factory. |
||
| 86 | * |
||
| 87 | * @return self |
||
| 88 | */ |
||
| 89 | 2 | public static function getDefaultInstance(): self |
|
| 97 | |||
| 98 | /** |
||
| 99 | * Returns a list of namespaces. |
||
| 100 | * |
||
| 101 | * @return array |
||
| 102 | */ |
||
| 103 | 9 | public function getNamespaces(): array |
|
| 107 | |||
| 108 | /** |
||
| 109 | * Creates a rule based on its name with the defined arguments. |
||
| 110 | * |
||
| 111 | * @param string $ruleName |
||
| 112 | * @param array $arguments |
||
| 113 | * |
||
| 114 | * @throws InvalidClassException |
||
| 115 | * @throws RuleNotFoundException |
||
| 116 | * |
||
| 117 | * @return Rule |
||
| 118 | */ |
||
| 119 | 6 | public function rule(string $ruleName, array $arguments = []): Rule |
|
| 123 | |||
| 124 | public function exception(Message $message): ValidationException |
||
| 130 | |||
| 131 | public function message(Result $result, Template $template = null): Message |
||
| 138 | |||
| 139 | public function template(Result $result): Template |
||
| 161 | |||
| 162 | /** |
||
| 163 | * Returns a reflection of a rule based on its name. |
||
| 164 | * |
||
| 165 | * |
||
| 166 | * @param string $ruleName |
||
| 167 | * |
||
| 168 | * @throws RuleNotFoundException |
||
| 169 | * |
||
| 170 | * @return ReflectionClass |
||
| 171 | */ |
||
| 172 | 6 | private function getRuleReflection(string $ruleName): ReflectionClass |
|
| 185 | |||
| 186 | /** |
||
| 187 | * Returns a reflection of an exception based on a rule name. |
||
| 188 | * |
||
| 189 | * |
||
| 190 | * @param string $ruleName |
||
| 191 | * |
||
| 192 | * @throws ExceptionNotFoundException |
||
| 193 | * |
||
| 194 | * @return ReflectionClass |
||
| 195 | */ |
||
| 196 | private function getExceptionReflection(string $ruleName): ReflectionClass |
||
| 209 | |||
| 210 | /** |
||
| 211 | * Creates a ReflectionClass object based on a class name. |
||
| 212 | * |
||
| 213 | * This method always return the same object for a given class name in order |
||
| 214 | * to improve performance. Also checks if the reflection is child of $parentClass |
||
| 215 | * and if it is instantiable. |
||
| 216 | * |
||
| 217 | * @param string $className |
||
| 218 | * @param string $parentClassName |
||
| 219 | * |
||
| 220 | * @throws InvalidClassException When not valid. |
||
| 221 | * |
||
| 222 | * @return ReflectionClass |
||
| 223 | */ |
||
| 224 | 5 | private function getReflection(string $className, string $parentClassName): ReflectionClass |
|
| 240 | } |
||
| 241 |
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..