@@ -14,7 +14,7 @@ discard block |
||
| 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 |
||
| 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 | |
@@ -39,8 +39,9 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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; |
@@ -14,7 +14,7 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -92,7 +92,7 @@ discard block |
||
| 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 |
||
| 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; |
@@ -43,8 +43,9 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | |