1 | <?php |
||
26 | class ValidatorFactory implements ValidatorFactoryInterface |
||
27 | { |
||
28 | /** |
||
29 | * @var PropertyValidatorInterface[] |
||
30 | */ |
||
31 | private static $aValidatorMap = [ |
||
32 | self::NOT_EMPTY_VALIDATOR => NotEmpty::DIC_NAME, |
||
33 | self::NAME_VALIDATOR => JobName::DIC_NAME, |
||
34 | self::EPSILON_VALIDATOR => Epsilon::DIC_NAME, |
||
35 | self::BOOLEAN_VALIDATOR => IsBoolean::DIC_NAME, |
||
36 | self::SCHEDULE_VALIDATOR => Schedule::DIC_NAME, |
||
37 | self::ARRAY_VALIDATOR => IsArray::DIC_NAME, |
||
38 | self::RETRY_VALIDATOR => Retries::DIC_NAME, |
||
39 | self::CONSTRAINTS_VALIDATOR => Constraints::DIC_NAME, |
||
40 | self::CONTAINER_VALIDATOR => Container::DIC_NAME, |
||
41 | self::COMMAND_VALIDATOR => Command::DIC_NAME, |
||
42 | ]; |
||
43 | |||
44 | /** |
||
45 | * @var ContainerInterface |
||
46 | */ |
||
47 | private $oServiceContainer; |
||
48 | |||
49 | /** |
||
50 | * ValidatorFactory constructor. |
||
51 | * @param ContainerInterface $oServiceContainer |
||
52 | */ |
||
53 | public function __construct(ContainerInterface $oServiceContainer) |
||
57 | |||
58 | /** |
||
59 | * @param int $iValidator |
||
60 | * @return PropertyValidatorInterface |
||
61 | */ |
||
62 | public function getValidator($iValidator) |
||
71 | } |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: