1 | <?php |
||
8 | class Route |
||
9 | { |
||
10 | /** |
||
11 | * @var string |
||
12 | */ |
||
13 | private $name; |
||
14 | |||
15 | /** |
||
16 | * @var array |
||
17 | */ |
||
18 | private $methods = []; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $pattern; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $controller; |
||
29 | |||
30 | /** |
||
31 | * @var array |
||
32 | */ |
||
33 | private $asserts = []; |
||
34 | |||
35 | /** |
||
36 | * @var array |
||
37 | */ |
||
38 | private $values = []; |
||
39 | |||
40 | /** |
||
41 | * @param array $methods |
||
42 | * @param string $pattern |
||
43 | * @param string $controller |
||
44 | * @param array $asserts |
||
45 | * @param array $values |
||
46 | * @param string $name |
||
47 | */ |
||
48 | public function __construct( |
||
65 | |||
66 | /** |
||
67 | * @return string |
||
68 | */ |
||
69 | public function getName() |
||
73 | |||
74 | /** |
||
75 | * @return array |
||
76 | */ |
||
77 | public function getMethods() |
||
81 | |||
82 | /** |
||
83 | * @return string |
||
84 | */ |
||
85 | public function getPattern() |
||
89 | |||
90 | /** |
||
91 | * @return string |
||
92 | */ |
||
93 | public function getController() |
||
97 | |||
98 | /** |
||
99 | * @return array |
||
100 | */ |
||
101 | public function getAsserts() |
||
105 | |||
106 | /** |
||
107 | * @return array |
||
108 | */ |
||
109 | public function getValues() |
||
113 | |||
114 | /** |
||
115 | * @param array $route |
||
116 | * @return Route |
||
117 | */ |
||
118 | public static function fromArray(array $route) |
||
145 | } |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.