1 | <?php |
||
19 | class BasicAuth implements ExcluderInterface |
||
20 | { |
||
21 | /** |
||
22 | * List of user/password to be excluded. |
||
23 | * |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $users = []; |
||
27 | |||
28 | /** |
||
29 | * BasicAuth constructor. |
||
30 | * |
||
31 | * @param string|array $users |
||
|
|||
32 | * @param mixed $password |
||
33 | */ |
||
34 | public function __construct($users = null, $password = null) |
||
46 | |||
47 | /** |
||
48 | * Add user. |
||
49 | * |
||
50 | * @param string $userName |
||
51 | * @param mixed $password |
||
52 | * |
||
53 | * @return $this |
||
54 | */ |
||
55 | public function addUser($userName, $password = null) |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | * |
||
67 | * @throws \RuntimeException |
||
68 | */ |
||
69 | public function isExcluded(ServerRequestInterface $request) |
||
85 | |||
86 | /** |
||
87 | * Retrieve request authentication information. |
||
88 | * |
||
89 | * @param ServerRequestInterface $request |
||
90 | * |
||
91 | * @return array |
||
92 | */ |
||
93 | protected function getAuth(ServerRequestInterface $request) |
||
105 | } |
||
106 |
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.