Test Failed
Branch main (c9d1c5)
by Josh
04:45 queued 02:23
created
src/Entity/OrderRequest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@
 block discarded – undo
164 164
      */
165 165
     public function setDeliveryMethod(string $delivery_method): void
166 166
     {
167
-        if (!in_array($delivery_method, ['direct', 'instant'])) {
167
+        if (!in_array($delivery_method, [ 'direct', 'instant' ])) {
168 168
             throw new Exception('Invalid delivery method: ' . $delivery_method);
169 169
         }
170 170
 
Please login to merge, or discard this patch.
src/Entity/AbstractEntity.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
                 continue;
24 24
             }
25 25
             if ($value instanceof DateTime) {
26
-                $data[$key] = $value->format('Y-m-d H:i:s');
26
+                $data[ $key ] = $value->format('Y-m-d H:i:s');
27 27
             }
28 28
         }
29 29
 
Please login to merge, or discard this patch.
examples/create_an_order.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 /** @var Client $client */
13 13
 
14 14
 
15
-$orderRequest = new OrderRequest('ZAPPO-US',10,'USD');
15
+$orderRequest = new OrderRequest('ZAPPO-US', 10, 'USD');
16 16
 $orderRequest->setIdempotencyKey(uniqid());
17 17
 
18 18
 $orderResponse = $client->createAnOrder($orderRequest);
Please login to merge, or discard this patch.
src/Entity/OrderResponse.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     /**
14 14
      * @var Ecode[]
15 15
      */
16
-    protected array $e_codes = [];
16
+    protected array $e_codes = [ ];
17 17
     protected string $error_code;
18 18
     protected string $error_details;
19 19
     protected string $error_string;
@@ -49,10 +49,10 @@  discard block
 block discarded – undo
49 49
      */
50 50
     public function setECodes(array $e_codes): void
51 51
     {
52
-        $this->e_codes = [];
52
+        $this->e_codes = [ ];
53 53
 
54 54
         foreach ($e_codes as $e_code) {
55
-            $this->e_codes[] = new Ecode($e_code);
55
+            $this->e_codes[ ] = new Ecode($e_code);
56 56
         }
57 57
     }
58 58
 
Please login to merge, or discard this patch.
src/Client.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     public function authentication(): AuthResponse
64 64
     {
65 65
         $response = $this->getHttpClient()->get($this->getEndpoint() . '/auth', [
66
-            'auth' => [$this->user_id, $this->api_key]
66
+            'auth' => [ $this->user_id, $this->api_key ]
67 67
         ]);
68 68
 
69 69
         return new AuthResponse(json_decode($response->getBody(), true));
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         if (
75 75
             !in_array(
76 76
                 $currency_code,
77
-                ['AUD', 'CAD', 'CHF', 'CZK', 'DKK', 'EUR', 'GBP', 'HUF', 'NOK', 'NZD', 'PLN', 'SEK', 'USD']
77
+                [ 'AUD', 'CAD', 'CHF', 'CZK', 'DKK', 'EUR', 'GBP', 'HUF', 'NOK', 'NZD', 'PLN', 'SEK', 'USD' ]
78 78
             )
79 79
         ) {
80 80
             // Murder a kitten...
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         }
83 83
 
84 84
         $response = $this->getHttpClient()->get($this->getEndpoint() . '/balance/' . $currency_code, [
85
-            'auth' => [$this->user_id, $this->api_key]
85
+            'auth' => [ $this->user_id, $this->api_key ]
86 86
         ]);
87 87
 
88 88
         return new Balance(json_decode($response->getBody(), true));
@@ -99,11 +99,11 @@  discard block
 block discarded – undo
99 99
     public function listAllProducts(): Generator
100 100
     {
101 101
         $response = $this->getHttpClient()->get($this->getEndpoint() . '/products', [
102
-            'auth' => [$this->user_id, $this->api_key]
102
+            'auth' => [ $this->user_id, $this->api_key ]
103 103
         ]);
104 104
 
105 105
         $json = json_decode($response->getBody(), true);
106
-        foreach ($json['products'] as $product) {
106
+        foreach ($json[ 'products' ] as $product) {
107 107
             yield new Product($product);
108 108
         }
109 109
     }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     public function findAProduct($productCode): Product
112 112
     {
113 113
         $response = $this->getHttpClient()->get($this->getEndpoint() . '/products/' . $productCode, [
114
-            'auth' => [$this->user_id, $this->api_key]
114
+            'auth' => [ $this->user_id, $this->api_key ]
115 115
         ]);
116 116
 
117 117
         return new Product(json_decode($response->getBody(), true));
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
             'headers' => [
124 124
                 'content-type' => 'application/json',
125 125
             ],
126
-            'auth' => [$this->user_id, $this->api_key],
126
+            'auth' => [ $this->user_id, $this->api_key ],
127 127
             'body' => json_encode($orderRequest)
128 128
         ]);
129 129
 
Please login to merge, or discard this patch.