@@ -25,7 +25,9 @@ |
||
25 | 25 | public static function create(Connector $connector, string $model, array $data = []): ?Model |
26 | 26 | { |
27 | 27 | $model = strtolower($model); |
28 | - if (!array_key_exists($model, self::CLASS_MAP)) return null; |
|
28 | + if (!array_key_exists($model, self::CLASS_MAP)) { |
|
29 | + return null; |
|
30 | + } |
|
29 | 31 | |
30 | 32 | $cls = self::CLASS_MAP[$model]; |
31 | 33 | return new $cls($connector, $data); |
@@ -83,7 +83,7 @@ |
||
83 | 83 | |
84 | 84 | if (!$response->isValid() || !$json || !array_key_exists('access_token', $json)) { |
85 | 85 | return $json['access_token']; |
86 | - } else { |
|
86 | + }else { |
|
87 | 87 | return ''; |
88 | 88 | } |
89 | 89 | } |
@@ -109,6 +109,6 @@ |
||
109 | 109 | */ |
110 | 110 | protected function auth_url(string $path): string |
111 | 111 | { |
112 | - return $this->_auth_domain . '/' . ltrim($path, '/'); |
|
112 | + return $this->_auth_domain.'/'.ltrim($path, '/'); |
|
113 | 113 | } |
114 | 114 | } |
@@ -43,7 +43,9 @@ |
||
43 | 43 | public function __get(string $service): Model |
44 | 44 | { |
45 | 45 | $obj = ObjectFactory::create($this, $service); |
46 | - if (!$obj) throw new BadMethodException("Service for `{$service}` does not exist"); |
|
46 | + if (!$obj) { |
|
47 | + throw new BadMethodException("Service for `{$service}` does not exist"); |
|
48 | + } |
|
47 | 49 | |
48 | 50 | return $obj; |
49 | 51 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | */ |
129 | 129 | public function getIterator(): Generator |
130 | 130 | { |
131 | - return (function () { |
|
131 | + return (function() { |
|
132 | 132 | $i = 0; |
133 | 133 | $x = 0; |
134 | 134 | $m = $this->count(); |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $t = $this->getItems(ceil($i / self::PAGE_LENGTH)); |
140 | 140 | } |
141 | 141 | |
142 | - yield $i => $t[self::PAGE_LENGTH - $x]; |
|
142 | + yield $i => $t[self::PAGE_LENGTH-$x]; |
|
143 | 143 | |
144 | 144 | $x -= 1; |
145 | 145 | } |
@@ -67,7 +67,9 @@ |
||
67 | 67 | |
68 | 68 | foreach ($data['items'] as $item) { |
69 | 69 | $obj = ObjectFactory::make($this->getClient(), $item); |
70 | - if (!$obj) continue; |
|
70 | + if (!$obj) { |
|
71 | + continue; |
|
72 | + } |
|
71 | 73 | |
72 | 74 | $this->_items[$page][] = $obj; |
73 | 75 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | */ |
13 | 13 | class ObjectResource extends ApiResource { |
14 | 14 | |
15 | - private $_object_data = []; |
|
15 | + private $_object_data = []; |
|
16 | 16 | |
17 | 17 | public function __construct(Connector $connector, array $_object_data = []) |
18 | 18 | { |
@@ -12,7 +12,7 @@ |
||
12 | 12 | |
13 | 13 | public function all(): ListResource |
14 | 14 | { |
15 | - return new ListResource($this->getClient(), ); |
|
15 | + return new ListResource($this->getClient(),); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | } |