Completed
Push — gh-27-android-devices ( 34c0bd )
by Serhii
02:00
created
src/Tools.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,13 +28,13 @@
 block discarded – undo
28 28
         if (preg_match($version, $uaString)) {
29 29
             preg_match($version, $uaString, $v);
30 30
             $version = $v[0];
31
-            $version = preg_replace('/' . $phrase . '/', '', $version);
31
+            $version = preg_replace('/'.$phrase.'/', '', $version);
32 32
             $version = str_replace(';', '', $version);
33 33
             $version = str_replace(' ', '', $version);
34 34
             $version = str_replace('/', '', $version);
35 35
             $version = str_replace('_', '.', $version);
36 36
 
37
-            if(preg_match('/ Windows /', $uaString)) {
37
+            if (preg_match('/ Windows /', $uaString)) {
38 38
                 $version = static::getWindowsVersion($version);
39 39
             }
40 40
             return $version;
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@
 block discarded – undo
104 104
 
105 105
     /**
106 106
      * Execute getter
107
-     * @param $object
107
+     * @param Data\Result $object
108 108
      * @param string $key
109 109
      * @return null
110 110
      */
Please login to merge, or discard this patch.
src/Detection/AbstractDetection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
      */
48 48
     protected function initResultObject()
49 49
     {
50
-        if(!array_key_exists('default', $this->config)) {
50
+        if (!array_key_exists('default', $this->config)) {
51 51
             return null;
52 52
         }
53 53
         // init default value from data
Please login to merge, or discard this patch.
src/Detector.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -87,11 +87,11 @@
 block discarded – undo
87 87
         $dataProvider->setDataDirectory($dataDirectory);
88 88
         $this->setDataProvider($dataProvider);
89 89
         $this->detectors = [];
90
-        $check = ['os','device', 'browser', 'robot'];
90
+        $check = ['os', 'device', 'browser', 'robot'];
91 91
         Tools::setWindowsConfig($dataProvider->getConfig()['windows']);
92 92
         foreach ($check as $detectionType) {
93 93
             $className = sprintf('\\EndorphinStudio\\Detector\\Detection\\%s', ucfirst(sprintf('%sDetector', $detectionType)));
94
-            if(class_exists($className)) {
94
+            if (class_exists($className)) {
95 95
                 $this->detectors[$detectionType] = new $className();
96 96
                 $this->detectors[$detectionType]->init($this);
97 97
             }
Please login to merge, or discard this patch.
src/Detection/ModelDetector.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,14 +17,14 @@  discard block
 block discarded – undo
17 17
     protected function setupResultObject()
18 18
     {
19 19
         $name = $this->additionalInfo['name'];
20
-        if(!\array_key_exists($name, $this->config)) {
20
+        if (!\array_key_exists($name, $this->config)) {
21 21
             return;
22 22
         }
23 23
         $patternList = $this->config[$name];
24 24
         foreach ($patternList as $series => $pattern) {
25 25
             $pattern = sprintf('/%s/', $pattern);
26 26
             $result = \preg_match($pattern, $this->detector->getUserAgent(), $model);
27
-            if($result) {
27
+            if ($result) {
28 28
                 $this->resultObject->setModel(sprintf('%s%s', $series, $model[1]));
29 29
                 $this->resultObject->setSeries($series);
30 30
             }
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
             $this->resultObject = new Model();
44 44
         }
45 45
         $this->setupResultObject();
46
-        if($this->resultObject->getModel()) {
46
+        if ($this->resultObject->getModel()) {
47 47
             $this->detector->getResultObject()->getDevice()->setModel($this->resultObject);
48 48
             $this->detector->getResultObject()->getDevice()->setHasModel(true);
49 49
         }
Please login to merge, or discard this patch.
src/Detection/DeviceDetector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 
24 24
     protected function afterDetection()
25 25
     {
26
-        if(\array_key_exists('hasModel', $this->additionalInfo['originalInfo']) && $this->additionalInfo['originalInfo']['hasModel'] === true) {
26
+        if (\array_key_exists('hasModel', $this->additionalInfo['originalInfo']) && $this->additionalInfo['originalInfo']['hasModel'] === true) {
27 27
             // detect model
28 28
             $detector = new ModelDetector();
29 29
             $detector->init($this->detector);
Please login to merge, or discard this patch.