| @@ -40,7 +40,9 @@ | ||
| 40 | 40 | public function getJSON(): ?array | 
| 41 | 41 |      { | 
| 42 | 42 | $data = json_decode($this->result, true); | 
| 43 | - if (!is_array($data)) return null; | |
| 43 | +        if (!is_array($data)) { | |
| 44 | + return null; | |
| 45 | + } | |
| 44 | 46 | |
| 45 | 47 | return $data; | 
| 46 | 48 | } | 
| @@ -17,7 +17,7 @@ discard block | ||
| 17 | 17 | $randomString = ''; | 
| 18 | 18 | |
| 19 | 19 |          for ($i = 0; $i < $length; $i++) { | 
| 20 | - $randomString .= $characters[rand(0, $charactersLength - 1)]; | |
| 20 | + $randomString .= $characters[rand(0, $charactersLength-1)]; | |
| 21 | 21 | } | 
| 22 | 22 | |
| 23 | 23 | return $randomString; | 
| @@ -29,6 +29,6 @@ discard block | ||
| 29 | 29 | */ | 
| 30 | 30 | public static function pack(string $str): string | 
| 31 | 31 |      { | 
| 32 | -        return rtrim(strtr(base64_encode(pack('H*',  hash('sha256', $str))), '+/', '-_'), '='); | |
| 32 | +        return rtrim(strtr(base64_encode(pack('H*', hash('sha256', $str))), '+/', '-_'), '='); | |
| 33 | 33 | } | 
| 34 | 34 | } | 
| @@ -19,7 +19,9 @@ | ||
| 19 | 19 | public static function inst(Connector $connector, string $service): ?ApiService | 
| 20 | 20 |      { | 
| 21 | 21 | $service = strtolower($service); | 
| 22 | - if (!array_key_exists($service, ClassMap::SERVICES)) return null; | |
| 22 | +        if (!array_key_exists($service, ClassMap::SERVICES)) { | |
| 23 | + return null; | |
| 24 | + } | |
| 23 | 25 | |
| 24 | 26 | $cls = ClassMap::SERVICES[$service]; | 
| 25 | 27 | return new $cls($connector); | 
| @@ -98,7 +98,9 @@ | ||
| 98 | 98 |      { | 
| 99 | 99 | $curl = $this->getClient()->curl_api($url, 'DELETE', $params); | 
| 100 | 100 | |
| 101 | - if ($curl->isValid()) return true; | |
| 101 | +        if ($curl->isValid()) { | |
| 102 | + return true; | |
| 103 | + } | |
| 102 | 104 | |
| 103 | 105 | throw new ApiException($curl->getError()); | 
| 104 | 106 | } | 
| @@ -77,7 +77,7 @@ | ||
| 77 | 77 |          if ($curl->isValid()) { | 
| 78 | 78 |              if ($curl->isJSON()) { | 
| 79 | 79 | return ObjectFactory::make($this->getClient(), $curl->getJSON()); | 
| 80 | -            } else { | |
| 80 | +            }else { | |
| 81 | 81 | return true; | 
| 82 | 82 | } | 
| 83 | 83 | } | 
| @@ -23,7 +23,7 @@ discard block | ||
| 23 | 23 | public function fetch(int $id): ?Customer | 
| 24 | 24 |      { | 
| 25 | 25 | /** @var Customer|null $fetch */ | 
| 26 | -        $fetch = $this->_get('api/customers/customer' . $id); | |
| 26 | +        $fetch = $this->_get('api/customers/customer'.$id); | |
| 27 | 27 | return $fetch; | 
| 28 | 28 | } | 
| 29 | 29 | |
| @@ -50,7 +50,7 @@ discard block | ||
| 50 | 50 | public function update(int $id, array $data): ?Customer | 
| 51 | 51 |      { | 
| 52 | 52 | /** @var Customer|null $post */ | 
| 53 | -        $post = $this->_post('api/customers/customer/' . $id, $data); | |
| 53 | +        $post = $this->_post('api/customers/customer/'.$id, $data); | |
| 54 | 54 | return $post; | 
| 55 | 55 | } | 
| 56 | 56 | |
| @@ -23,7 +23,7 @@ discard block | ||
| 23 | 23 | public function fetch(int $id): ?Address | 
| 24 | 24 |      { | 
| 25 | 25 | /** @var Address|null $address */ | 
| 26 | -        $address = $this->_get('api/addresses/address' . $id); | |
| 26 | +        $address = $this->_get('api/addresses/address'.$id); | |
| 27 | 27 | return $address; | 
| 28 | 28 | } | 
| 29 | 29 | |
| @@ -50,7 +50,7 @@ discard block | ||
| 50 | 50 | public function update(int $id, array $data): ?Address | 
| 51 | 51 |      { | 
| 52 | 52 | /** @var Address|null $address */ | 
| 53 | -        $address = $this->_post('api/addresses/address/' . $id, $data); | |
| 53 | +        $address = $this->_post('api/addresses/address/'.$id, $data); | |
| 54 | 54 | return $address; | 
| 55 | 55 | } | 
| 56 | 56 | |
| @@ -59,7 +59,9 @@ | ||
| 59 | 59 | */ | 
| 60 | 60 | public function Customer(): ?Customer | 
| 61 | 61 |      { | 
| 62 | - if (!$this->CustomerID) return null; | |
| 62 | +        if (!$this->CustomerID) { | |
| 63 | + return null; | |
| 64 | + } | |
| 63 | 65 | |
| 64 | 66 | /** @var Customer|null $customer */ | 
| 65 | 67 | $customer = $this->getClient()->customers->fetch($this->CustomerID); | 
| @@ -62,7 +62,7 @@ | ||
| 62 | 62 | $t = $this->getItems(); | 
| 63 | 63 | $c = $this->count(); | 
| 64 | 64 | |
| 65 | -        return (function () use ($t, $c) { | |
| 65 | +        return (function() use ($t, $c) { | |
| 66 | 66 | $i = 0; | 
| 67 | 67 | |
| 68 | 68 |              while ($i < $c) { | 
| @@ -42,7 +42,9 @@ discard block | ||
| 42 | 42 | |
| 43 | 43 |              foreach ($list as $item) { | 
| 44 | 44 | $obj = ObjectFactory::make($this->getClient(), $item); | 
| 45 | - if (!$obj) continue; | |
| 45 | +                if (!$obj) { | |
| 46 | + continue; | |
| 47 | + } | |
| 46 | 48 | |
| 47 | 49 | $this->_items[] = $obj; | 
| 48 | 50 | } | 
| @@ -76,6 +78,8 @@ discard block | ||
| 76 | 78 | */ | 
| 77 | 79 | public function first(): ?Model | 
| 78 | 80 |      { | 
| 79 | - foreach ($this as $obj) return $obj; | |
| 81 | +        foreach ($this as $obj) { | |
| 82 | + return $obj; | |
| 83 | + } | |
| 80 | 84 | } | 
| 81 | 85 | } | 
| @@ -37,7 +37,7 @@ discard block | ||
| 37 | 37 | public function fetch(int $id): ?CustomPage | 
| 38 | 38 |      { | 
| 39 | 39 | /** @var CustomPage|null $fetch */ | 
| 40 | -        $fetch = $this->_get('api/pages/page' . $id); | |
| 40 | +        $fetch = $this->_get('api/pages/page'.$id); | |
| 41 | 41 | return $fetch; | 
| 42 | 42 | } | 
| 43 | 43 | |
| @@ -64,7 +64,7 @@ discard block | ||
| 64 | 64 | public function update(int $id, array $data): ?CustomPage | 
| 65 | 65 |      { | 
| 66 | 66 | /** @var CustomPage|null $post */ | 
| 67 | -        $post = $this->_post('api/pages/page/' . $id, $data); | |
| 67 | +        $post = $this->_post('api/pages/page/'.$id, $data); | |
| 68 | 68 | return $post; | 
| 69 | 69 | } | 
| 70 | 70 | |