1 | <?php |
||
46 | class RouteParameter |
||
47 | { |
||
48 | const DEFAULT_REGEX = '.[^/\.]{0,}'; |
||
49 | |||
50 | /** |
||
51 | * |
||
52 | * @var string |
||
53 | */ |
||
54 | protected $name; |
||
55 | |||
56 | /** |
||
57 | * |
||
58 | * @var boolean |
||
59 | */ |
||
60 | protected $required; |
||
61 | |||
62 | /** |
||
63 | * |
||
64 | * @var string |
||
65 | */ |
||
66 | protected $regex; |
||
67 | |||
68 | /** |
||
69 | * |
||
70 | * @var mixed |
||
71 | */ |
||
72 | protected $default; |
||
73 | |||
74 | /** |
||
75 | * |
||
76 | * @var string |
||
77 | */ |
||
78 | protected $value; |
||
79 | |||
80 | /** |
||
81 | * |
||
82 | * @param type $name |
||
83 | * @param type $default |
||
|
|||
84 | * @param type $regex |
||
85 | * @param type $required |
||
86 | * @param type $value |
||
87 | * |
||
88 | * @return void |
||
89 | */ |
||
90 | 13 | public function __construct($name, $default = null, |
|
99 | |||
100 | 13 | public function getName() |
|
104 | |||
105 | 7 | public function isRequired() |
|
109 | |||
110 | 7 | public function getRegex() |
|
114 | |||
115 | public function getDefault() |
||
119 | |||
120 | 4 | public function getValueOrDefault() |
|
124 | |||
125 | 2 | public function setValue($value) |
|
129 | |||
130 | 3 | public function getValue() |
|
134 | } |
||
135 |
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.
Most often this is a case of a parameter that can be null in addition to its declared types.