These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | |||
4 | namespace DoctrineModule\Validator\Service; |
||
5 | |||
6 | use Interop\Container\ContainerInterface; |
||
7 | use DoctrineModule\Validator\ObjectExists; |
||
8 | |||
9 | /** |
||
10 | * Factory for creating ObjectExists instances |
||
11 | * |
||
12 | * @license MIT |
||
13 | * @link http://www.doctrine-project.org/ |
||
14 | * @since 1.3.0 |
||
15 | * @author Fabian Grutschus <[email protected]> |
||
16 | */ |
||
17 | class ObjectExistsFactory extends AbstractValidatorFactory |
||
18 | { |
||
19 | protected $validatorClass = ObjectExists::class; |
||
20 | |||
21 | 1 | public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
22 | { |
||
23 | 1 | $container = $this->container($container); |
|
24 | |||
25 | 1 | $repository = $this->getRepository($container, $options); |
|
0 ignored issues
–
show
|
|||
26 | |||
27 | 1 | $validator = new ObjectExists($this->merge($options, [ |
|
28 | 1 | 'object_repository' => $repository, |
|
29 | 1 | 'fields' => $this->getFields($options), |
|
30 | ])); |
||
31 | |||
32 | 1 | return $validator; |
|
33 | } |
||
34 | } |
||
35 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.