Conditions | 5 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
65 | public function isExcluded(ServerRequestInterface $request) |
||
66 | { |
||
67 | if (!count($this->paths)) { |
||
68 | throw new \RuntimeException('No paths defined in path excluder'); |
||
69 | } |
||
70 | |||
71 | $currentPath = $request->getUri()->getPath(); |
||
72 | |||
73 | foreach ($this->paths as $path) { |
||
74 | if ($path === $currentPath || @preg_match($path, $currentPath) === 1) { |
||
75 | return true; |
||
76 | } |
||
77 | } |
||
78 | |||
79 | return false; |
||
80 | } |
||
81 | } |
||
82 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive. In addition it looks for parameters that have the generic type
array
and suggests a stricter type likearray<String>
.Most often this is a case of a parameter that can be null in addition to its declared types.