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 |
|
70 | |||
71 | /** |
||
72 | * @return URLParser |
||
73 | */ |
||
74 | 2 | public function getURLParser(): URLParser |
|
78 | |||
79 | /** |
||
80 | * @return HeaderParser |
||
81 | */ |
||
82 | 2 | public function getHeaderParser(): HeaderParser |
|
86 | } |
||
87 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.