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 ComponentException When the rule cannot be created |
||
| 115 | * |
||
| 116 | * @return Rule |
||
| 117 | */ |
||
| 118 | 6 | public function rule(string $ruleName, array $arguments = []): Rule |
|
| 141 | |||
| 142 | public function message(Result $result): Message |
||
| 158 | |||
| 159 | public function exception(Result $result): ValidationException |
||
| 174 | |||
| 175 | private function chooseTemplate(Templates $templates, bool $isInverted, string $templateId): Template |
||
| 192 | |||
| 193 | private function getExceptionReflection(Rule $rule): ReflectionClass |
||
| 199 | |||
| 200 | /** |
||
| 201 | * Creates a ReflectionClass object based on a class name. |
||
| 202 | * |
||
| 203 | * This method always return the same object for a given class name in order |
||
| 204 | * to improve performance. |
||
| 205 | * |
||
| 206 | * @param string $className |
||
| 207 | * |
||
| 208 | * @return ReflectionClass |
||
| 209 | */ |
||
| 210 | 5 | private function getReflection(string $className): ReflectionClass |
|
| 218 | } |
||
| 219 |
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..