1 | <?php |
||
19 | class Path implements ExcluderInterface |
||
20 | { |
||
21 | /** |
||
22 | * List of paths to be excluded. |
||
23 | * |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $paths = []; |
||
27 | |||
28 | /** |
||
29 | * Path constructor. |
||
30 | * |
||
31 | * @param string|array $paths |
||
|
|||
32 | */ |
||
33 | public function __construct($paths = null) |
||
45 | |||
46 | /** |
||
47 | * Add path. |
||
48 | * |
||
49 | * @param string $path |
||
50 | * |
||
51 | * @return $this |
||
52 | */ |
||
53 | public function addPath($path) |
||
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | public function isExcluded(ServerRequestInterface $request) |
||
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.