Completed
Pull Request — master (#14)
by Pavel
04:14
created

ConstructorFactoryResolver.php (1 issue)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Bankiru\Api\Doctrine;
4
5
use Bankiru\Api\Doctrine\ApiFactory\StaticApiFactoryFactory;
6
7
final class ConstructorFactoryResolver implements ApiFactoryResolverInterface
8
{
9
    /** @var  ApiFactoryInterface[] */
10
    private $factories = [];
11
12
    /** {@inheritdoc} */
13
    public function resolve($name)
14
    {
15
        if (!array_key_exists($name, $this->factories)) {
16
            $this->factories[$name] = new StaticApiFactoryFactory($name);
0 ignored issues
show
The call to StaticApiFactoryFactory::__construct() has too many arguments starting with $name.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
17
        }
18
19
        return $this->factories[$name];
20
    }
21
}
22