Passed
Branch feature/super-model (24c950)
by axel
02:55
created
src/MalScraper/Model/PeoplePictureModel.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
      *
15 15
      * @var string|int
16 16
      */
17
-	private $_id;
17
+    private $_id;
18 18
 
19 19
     /**
20 20
      * Default constructor.
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
      *
25 25
      * @return void
26 26
      */
27
-	public function __construct($id, $parserArea = '#content table tr td')
27
+    public function __construct($id, $parserArea = '#content table tr td')
28 28
     {
29
-    	$this->_id = $id;
29
+        $this->_id = $id;
30 30
         $this->_url = $this->_myAnimeListUrl.'/people/'.$id;
31
-    	$this->_parserArea = $parserArea;
31
+        $this->_parserArea = $parserArea;
32 32
 
33 33
         parent::errorCheck($this);
34 34
     }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     private function getId()
67 67
     {
68
-    	return $this->_id;
68
+        return $this->_id;
69 69
     }
70 70
 
71 71
     /**
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,8 +43,9 @@
 block discarded – undo
43 43
      */
44 44
     public function __call($method, $arguments)
45 45
     {
46
-        if ($this->_error)
47
-            return $this->_error;
46
+        if ($this->_error) {
47
+                    return $this->_error;
48
+        }
48 49
         return call_user_func_array([$this, $method], $arguments);
49 50
     }
50 51
 
Please login to merge, or discard this patch.
src/MalScraper/Model/StatModel.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,14 +14,14 @@  discard block
 block discarded – undo
14 14
      *
15 15
      * @var string
16 16
      */
17
-	private $_type;
17
+    private $_type;
18 18
 
19 19
     /**
20 20
      * Id of the anime or manga.
21 21
      *
22 22
      * @var string|int
23 23
      */
24
-	private $_id;
24
+    private $_id;
25 25
 
26 26
     /**
27 27
      * Default constructor.
@@ -32,12 +32,12 @@  discard block
 block discarded – undo
32 32
      *
33 33
      * @return void
34 34
      */
35
-	public function __construct($type, $id, $parserArea = '.js-scrollfix-bottom-rel')
35
+    public function __construct($type, $id, $parserArea = '.js-scrollfix-bottom-rel')
36 36
     {
37
-    	$this->_type = $type;
38
-    	$this->_id = $id;
37
+        $this->_type = $type;
38
+        $this->_id = $id;
39 39
         $this->_url = $this->_myAnimeListUrl.'/'.$type.'/'.$id;
40
-    	$this->_parserArea = $parserArea;
40
+        $this->_parserArea = $parserArea;
41 41
 
42 42
         parent::errorCheck($this);
43 43
     }
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      */
75 75
     private function getId()
76 76
     {
77
-    	return $this->_id;
77
+        return $this->_id;
78 78
     }
79 79
 
80 80
     /**
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,8 +52,9 @@  discard block
 block discarded – undo
52 52
      */
53 53
     public function __call($method, $arguments)
54 54
     {
55
-        if ($this->_error)
56
-            return $this->_error;
55
+        if ($this->_error) {
56
+                    return $this->_error;
57
+        }
57 58
         return call_user_func_array([$this, $method], $arguments);
58 59
     }
59 60
 
@@ -151,8 +152,9 @@  discard block
 block discarded – undo
151 152
         $user_area = $this->_parser->find('.table-recently-updated', 0);
152 153
         if ($user_area) {
153 154
             foreach ($user_area->find('tr') as $each_user) {
154
-                if (!$each_user->find('td', 0)->find('div', 0))
155
-                    continue;
155
+                if (!$each_user->find('td', 0)->find('div', 0)) {
156
+                                    continue;
157
+                }
156 158
 
157 159
                 $temp_user = [];
158 160
 
Please login to merge, or discard this patch.
src/MalScraper/Model/PeopleModel.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
      *
15 15
      * @var string|int
16 16
      */
17
-	private $_id;
17
+    private $_id;
18 18
 
19 19
     /**
20 20
      * Biodata area.
@@ -31,11 +31,11 @@  discard block
 block discarded – undo
31 31
      *
32 32
      * @return void
33 33
      */
34
-	public function __construct($id, $parserArea = '#contentWrapper')
34
+    public function __construct($id, $parserArea = '#contentWrapper')
35 35
     {
36
-    	$this->_id = $id;
36
+        $this->_id = $id;
37 37
         $this->_url = $this->_myAnimeListUrl.'/people/'.$id;
38
-    	$this->_parserArea = $parserArea;
38
+        $this->_parserArea = $parserArea;
39 39
 
40 40
         parent::errorCheck($this);
41 41
 
Please login to merge, or discard this patch.
Braces   +18 added lines, -12 removed lines patch added patch discarded remove patch
@@ -39,8 +39,9 @@  discard block
 block discarded – undo
39 39
 
40 40
         parent::errorCheck($this);
41 41
 
42
-        if (!$this->_error)
43
-            self::setBiodata();
42
+        if (!$this->_error) {
43
+                    self::setBiodata();
44
+        }
44 45
     }
45 46
 
46 47
     /**
@@ -53,8 +54,9 @@  discard block
 block discarded – undo
53 54
      */
54 55
     public function __call($method, $arguments)
55 56
     {
56
-        if ($this->_error)
57
-            return $this->_error;
57
+        if ($this->_error) {
58
+                    return $this->_error;
59
+        }
58 60
         return call_user_func_array([$this, $method], $arguments);
59 61
     }
60 62
 
@@ -147,19 +149,23 @@  discard block
 block discarded – undo
147 149
                 $biodata = trim($biodata[1]);
148 150
             }
149 151
 
150
-            if ($type == 'given_name' || $type == 'family_name' || $type == 'birthday')
151
-                return $biodata;
152
+            if ($type == 'given_name' || $type == 'family_name' || $type == 'birthday') {
153
+                            return $biodata;
154
+            }
152 155
 
153
-            if ($type == 'alternative_name')
154
-                return explode(', ', $biodata);
156
+            if ($type == 'alternative_name') {
157
+                            return explode(', ', $biodata);
158
+            }
155 159
 
156
-            if ($type == 'favorite')
157
-                return str_replace(',', '', $biodata);
160
+            if ($type == 'favorite') {
161
+                            return str_replace(',', '', $biodata);
162
+            }
158 163
 
159 164
             if ($type == 'website') {
160 165
                 preg_match('/".+"/', $biodata[0], $biodata);
161
-                if ($biodata[0] != '"http://"')
162
-                    return str_replace('"', '', $biodata[0]);
166
+                if ($biodata[0] != '"http://"') {
167
+                                    return str_replace('"', '', $biodata[0]);
168
+                }
163 169
             }
164 170
         }
165 171
         return null;
Please login to merge, or discard this patch.
src/MalScraper/Model/CharacterModel.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
      *
15 15
      * @var string|int
16 16
      */
17
-	private $_id;
17
+    private $_id;
18 18
 
19 19
     /**
20 20
      * Default constructor.
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
      *
25 25
      * @return void
26 26
      */
27
-	public function __construct($id, $parserArea = '#contentWrapper')
27
+    public function __construct($id, $parserArea = '#contentWrapper')
28 28
     {
29
-    	$this->_id = $id;
29
+        $this->_id = $id;
30 30
         $this->_url = $this->_myAnimeListUrl.'/character/'.$id;
31
-    	$this->_parserArea = $parserArea;
31
+        $this->_parserArea = $parserArea;
32 32
 
33 33
         parent::errorCheck($this);
34 34
     }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      *
93 93
      * @return string
94 94
      */
95
-    private function getName($isKanji=false)
95
+    private function getName($isKanji = false)
96 96
     {
97 97
         $html = $this->_parser->find('#content table tr', 0);
98 98
         $html = $html->find('td', 0)->next_sibling()->find('div[class=normal_header]', 0);
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
      *
152 152
      * @return array
153 153
      */
154
-    private function getMedia($type='anime')
154
+    private function getMedia($type = 'anime')
155 155
     {
156 156
         $mediaography = [];
157 157
         $mediaography_index = 0;
Please login to merge, or discard this patch.
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,8 +43,9 @@  discard block
 block discarded – undo
43 43
      */
44 44
     public function __call($method, $arguments)
45 45
     {
46
-        if ($this->_error)
47
-            return $this->_error;
46
+        if ($this->_error) {
47
+                    return $this->_error;
48
+        }
48 49
         return call_user_func_array([$this, $method], $arguments);
49 50
     }
50 51
 
@@ -80,8 +81,9 @@  discard block
 block discarded – undo
80 81
         $nickname = $this->_parser->find('h1', 0)->plaintext;
81 82
         $nickname = trim(preg_replace('/\s+/', ' ', $nickname));
82 83
         preg_match('/\"([^"])*/', $nickname, $nickname);
83
-        if ($nickname)
84
-            return substr($nickname[0], 1, strlen($nickname[0]) - 2);
84
+        if ($nickname) {
85
+                    return substr($nickname[0], 1, strlen($nickname[0]) - 2);
86
+        }
85 87
         return null;
86 88
     }
87 89
 
@@ -100,8 +102,9 @@  discard block
 block discarded – undo
100 102
         $name_kanji = $html->find('small', 0);
101 103
         $name_kanji = $name_kanji ? $name_kanji->plaintext : '';
102 104
 
103
-        if ($isKanji)
104
-            return preg_replace('/(\(|\))/', '', $name_kanji);
105
+        if ($isKanji) {
106
+                    return preg_replace('/(\(|\))/', '', $name_kanji);
107
+        }
105 108
         return trim(str_replace($name_kanji, '', $html->plaintext));
106 109
     }
107 110
 
Please login to merge, or discard this patch.