1 | <?php |
||
9 | class GenericException extends Exception |
||
10 | { |
||
11 | /** |
||
12 | * The exception inputs. |
||
13 | * |
||
14 | * @var array |
||
15 | */ |
||
16 | protected $inputs; |
||
17 | |||
18 | /** |
||
19 | * The exception redirection. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $redirection; |
||
24 | |||
25 | /** |
||
26 | * Create a new authorization exception. |
||
27 | * |
||
28 | * @param string $message |
||
29 | * @param array $redirection |
||
|
|||
30 | */ |
||
31 | public function __construct($message = 'This action is unauthorized.', $redirection = null, array $inputs = null) |
||
38 | |||
39 | /** |
||
40 | * Gets the Exception redirection. |
||
41 | * |
||
42 | * @return string |
||
43 | */ |
||
44 | final public function getRedirection() |
||
48 | |||
49 | /** |
||
50 | * Gets the Exception inputs. |
||
51 | * |
||
52 | * @return array |
||
53 | */ |
||
54 | final public function getInputs() |
||
58 | } |
||
59 |
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.