1 | <?php |
||
21 | abstract class AbstractDetection implements DetectionInterface |
||
22 | { |
||
23 | /** |
||
24 | * @var array Additional Info |
||
25 | */ |
||
26 | protected $additionalInfo = []; |
||
27 | /** |
||
28 | * @var string Key in config (os, device, etc.) |
||
29 | */ |
||
30 | protected $configKey = 'none'; |
||
31 | |||
32 | /** @var array Data for detection (patterns, etc.) */ |
||
33 | protected $config; |
||
34 | /** @var Detector Detector class */ |
||
35 | protected $detector; |
||
36 | |||
37 | /** @var AbstractData Result object */ |
||
38 | protected $resultObject; |
||
39 | |||
40 | /** |
||
41 | * @param Detector $detector Init detection class with detector |
||
42 | */ |
||
43 | public function init(Detector $detector) |
||
47 | |||
48 | /** |
||
49 | * Result object initialisation |
||
50 | * @return null |
||
51 | */ |
||
52 | protected function initResultObject() |
||
62 | |||
63 | /** |
||
64 | * Detect method |
||
65 | * @param array $additional Additional info |
||
66 | */ |
||
67 | public function detect(array $additional = []) |
||
78 | |||
79 | /** |
||
80 | * Setup Result Object |
||
81 | * @return void |
||
82 | */ |
||
83 | protected abstract function setupResultObject(); |
||
84 | |||
85 | /** |
||
86 | * Detect by pattern |
||
87 | * @param array $patternList list of patterns |
||
88 | * @return array|null |
||
89 | */ |
||
90 | protected function detectByPattern(array $patternList) |
||
101 | |||
102 | /** |
||
103 | * Get pattern form array |
||
104 | * @param string $patternId ID in config |
||
105 | * @param array $patternData array from yaml file |
||
106 | * @return array |
||
107 | */ |
||
108 | private function getPattern(string $patternId, array $patternData): array |
||
115 | |||
116 | /** |
||
117 | * Set attributes of result object |
||
118 | * @param array $info Array |
||
119 | */ |
||
120 | protected function setAttributes(array $info) |
||
129 | |||
130 | /** |
||
131 | * Detect by type |
||
132 | * @param string $key |
||
133 | * @return array |
||
134 | */ |
||
135 | protected function detectByType($key = 'none'): array |
||
149 | |||
150 | /** |
||
151 | * Detect by Key |
||
152 | * @param string $keyName |
||
153 | * @return array |
||
154 | */ |
||
155 | protected function detectByKey($keyName = 'family'): array |
||
168 | |||
169 | protected function afterDetection() { |
||
172 | } |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.