Conditions | 5 |
Paths | 5 |
Total Lines | 24 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
17 | public static function __callStatic($name, $args) |
||
18 | { |
||
19 | $filesystem = array_shift($args); |
||
20 | |||
21 | if (!($filesystem instanceof FilesystemInterface)) { |
||
22 | throw new \InvalidArgumentException(sprintf('Invalid argument. Expected a %s but got %s', FilesystemInterface::class, gettype($filesystem))); |
||
23 | } |
||
24 | |||
25 | $class = __NAMESPACE__.'\\'.ucfirst($name); |
||
26 | |||
27 | if (!class_exists($class)) { |
||
28 | throw new BadMethodCallException(sprintf('The repository class "%s" does not exists', $class)); |
||
29 | } |
||
30 | |||
31 | $container = new static(); |
||
32 | |||
33 | foreach ($filesystem->listContents() as $info) { |
||
34 | if ($info['type'] === 'dir') { |
||
35 | $container->{$info['filename']} = new $class($filesystem, $info['filename']); |
||
36 | } |
||
37 | } |
||
38 | |||
39 | return $container; |
||
40 | } |
||
41 | |||
71 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.