1 | <?php |
||
19 | class Header implements ExcluderInterface |
||
20 | { |
||
21 | /** |
||
22 | * Request headers. |
||
23 | * |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $headers; |
||
27 | |||
28 | /** |
||
29 | * Header constructor. |
||
30 | * |
||
31 | * @param array|string $headers |
||
|
|||
32 | * @param string $value |
||
33 | */ |
||
34 | public function __construct($headers = null, $value = null) |
||
46 | |||
47 | /** |
||
48 | * Add header. |
||
49 | * |
||
50 | * @param string $header |
||
51 | * @param string $value |
||
52 | * |
||
53 | * @return $this |
||
54 | */ |
||
55 | public function addHeader($header, $value = null) |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | * |
||
67 | * @throws \RuntimeException |
||
68 | */ |
||
69 | public function isExcluded(ServerRequestInterface $request) |
||
88 | } |
||
89 |
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.