These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace DoctrineModule\Validator\Service; |
||
6 | |||
7 | use DoctrineModule\Validator\NoObjectExists; |
||
8 | use Interop\Container\ContainerInterface; |
||
9 | |||
10 | /** |
||
11 | * Factory for creating NoObjectExists instances |
||
12 | * |
||
13 | * @link http://www.doctrine-project.org/ |
||
14 | */ |
||
15 | class NoObjectExistsFactory extends AbstractValidatorFactory |
||
16 | { |
||
17 | /** @var string */ |
||
18 | protected $validatorClass = NoObjectExists::class; |
||
19 | |||
20 | /** |
||
21 | * {@inheritDoc} |
||
22 | */ |
||
23 | 2 | public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null) |
|
24 | { |
||
25 | 2 | $container = $this->container($container); |
|
26 | |||
27 | 2 | $repository = $this->getRepository($container, $options); |
|
0 ignored issues
–
show
|
|||
28 | |||
29 | 2 | return new NoObjectExists($this->merge($options, [ |
|
30 | 2 | 'object_repository' => $repository, |
|
31 | 2 | 'fields' => $this->getFields($options), |
|
32 | ])); |
||
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.