1 | <?php |
||
17 | class Detector |
||
18 | { |
||
19 | /** |
||
20 | * @var StorageInterface |
||
21 | */ |
||
22 | private $dataProvider; |
||
23 | |||
24 | /** |
||
25 | * @return StorageInterface |
||
26 | */ |
||
27 | public function getDataProvider(): StorageInterface |
||
31 | |||
32 | /** |
||
33 | * @return Result |
||
34 | */ |
||
35 | public function getResultObject(): Result |
||
39 | |||
40 | /** |
||
41 | * @var Result |
||
42 | */ |
||
43 | private $resultObject; |
||
44 | |||
45 | /** |
||
46 | * @param StorageInterface $dataProvider |
||
47 | */ |
||
48 | public function setDataProvider(StorageInterface $dataProvider) |
||
52 | |||
53 | /** |
||
54 | * @return mixed |
||
55 | */ |
||
56 | public function getUserAgent() |
||
60 | |||
61 | private $ua; |
||
62 | |||
63 | /** |
||
64 | * @var array |
||
65 | */ |
||
66 | private $detectors; |
||
67 | |||
68 | /** |
||
69 | * Detector constructor. |
||
70 | * @param string $dataProvider |
||
71 | * @param string $format |
||
72 | * @throws StorageException |
||
73 | */ |
||
74 | public function __construct(string $dataProvider = '\\EndorphinStudio\\Detector\\Storage\\YamlStorage', string $format = 'yaml') |
||
91 | |||
92 | public function analyze(string $ua = 'ua') |
||
106 | |||
107 | private function detect($config, $type) |
||
111 | |||
112 | public function getPatternList($list, $type) |
||
116 | } |
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.