1 | <?php |
||
15 | class GenericRequestFactory implements RequestFactory { |
||
16 | |||
17 | /** |
||
18 | * @var URLParser |
||
19 | */ |
||
20 | protected $URLParser; |
||
21 | /** |
||
22 | * @var HeaderParser |
||
23 | */ |
||
24 | private $headerParser; |
||
25 | |||
26 | /** |
||
27 | * BasicRequestFactory constructor. |
||
28 | * @param URLParser $URLParser |
||
29 | * @param HeaderParser $headerParser |
||
30 | */ |
||
31 | 4 | public function __construct(URLParser $URLParser, HeaderParser $headerParser) |
|
36 | |||
37 | /** |
||
38 | * Creates a request from raw $data and a $url |
||
39 | * @param ServerRequestInterface $serverRequest |
||
40 | * @return APIRequest |
||
41 | * @throws InvalidRequestURLException |
||
42 | */ |
||
43 | 2 | public function create(ServerRequestInterface $serverRequest): APIRequest |
|
68 | |||
69 | /** |
||
70 | * @return URLParser |
||
71 | */ |
||
72 | 2 | public function getURLParser(): URLParser |
|
76 | |||
77 | /** |
||
78 | * @return HeaderParser |
||
79 | */ |
||
80 | 2 | public function getHeaderParser(): HeaderParser |
|
84 | } |
||
85 |
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.