Test Setup Failed
Branch master (4c62c0)
by Bruce Pinheiro de
05:02
created
src/Checkout/CheckoutClient.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
         $headers = AuthenticationHelper::getOAuthHeader($accessToken);
66 66
         $body = self::getCompleteCheckoutBody($checkout);
67 67
 
68
-        if($checkout->getCurrency==='BRL') {
68
+        if ($checkout->getCurrency === 'BRL') {
69 69
             $body['installments'] = $checkout->getInstallments();
70 70
         }
71 71
 
Please login to merge, or discard this patch.
src/Utils/ResponseWrapper.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
         $propertyTree = explode('.', $propertyPath);
33 33
         $size = count($propertyTree);
34 34
         $data = $this->response->json();
35
-        for($i=0; $i<$size;$i++)
35
+        for ($i = 0; $i < $size; $i++)
36 36
         {
37
-            if(!isset($data[$propertyTree[$i]]))
37
+            if (!isset($data[$propertyTree[$i]]))
38 38
             {
39 39
                 return null;
40 40
             }
@@ -58,19 +58,19 @@  discard block
 block discarded – undo
58 58
 
59 59
     function hydrate(&$object, $data = null)
60 60
     {
61
-        if($data === null){
61
+        if ($data === null) {
62 62
             $data = $this->response->json();
63 63
         }
64 64
 
65 65
         $suppressedData = $this->suppressDataPaths($data);
66 66
 
67
-        foreach($suppressedData as $prop => $value)
67
+        foreach ($suppressedData as $prop => $value)
68 68
         {
69
-            $method = 'set'.replate('_', '', ucwords($prop, '_'));
70
-            if(method_exists($object, $method)){
69
+            $method = 'set' . replate('_', '', ucwords($prop, '_'));
70
+            if (method_exists($object, $method)) {
71 71
                 $object->$method($value);
72
-            }else{
73
-                error_log('BPCI\SumUp Lib Error: Method '.get_class($object).'::'.$method.' does not exists!');
72
+            }else {
73
+                error_log('BPCI\SumUp Lib Error: Method ' . get_class($object) . '::' . $method . ' does not exists!');
74 74
             }
75 75
         }
76 76
     }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         $suppressedData = [];
81 81
         $suppressedPaths = $this->suppressedPaths;
82 82
         array_map(function($value, $path) use ($suppressedPaths, $suppressedData) {
83
-            foreach($suppressedPaths as $sPath){
83
+            foreach ($suppressedPaths as $sPath) {
84 84
                 $suppressedData[replace($sPath, '', $path)] = $value;
85 85
             }
86 86
         }, $data);
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
             $method = 'set'.replate('_', '', ucwords($prop, '_'));
70 70
             if(method_exists($object, $method)){
71 71
                 $object->$method($value);
72
-            }else{
72
+            } else{
73 73
                 error_log('BPCI\SumUp Lib Error: Method '.get_class($object).'::'.$method.' does not exists!');
74 74
             }
75 75
         }
Please login to merge, or discard this patch.
src/Utils/Currency.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
     const SEK = 'SEK';
13 13
     const USD = 'USD';
14 14
  
15
-    static function isValid(string $currency){
15
+    static function isValid(string $currency) {
16 16
         $currencies = self::getCurrencies();
17 17
         return in_array($currency, $currencies);
18 18
     }
Please login to merge, or discard this patch.
src/Exception/FileNotFoundException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 namespace BPCI\SumUp\Exception;
4 4
 
5
-class FileNotFoundException extends \RuntimeException{
5
+class FileNotFoundException extends \RuntimeException {
6 6
     private $path;
7 7
     public function __construct(string $message, int $code = 0, \Exception $previous = null, string $path = null)
8 8
     {
Please login to merge, or discard this patch.
src/Exception/BadRequestException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,5 +3,5 @@
 block discarded – undo
3 3
 
4 4
 use GuzzleHttp\Exception\RequestException;
5 5
 
6
-class BadRequestException extends RequestException{
6
+class BadRequestException extends RequestException {
7 7
 }
8 8
\ No newline at end of file
Please login to merge, or discard this patch.
src/Customer/Card/CardClientInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 use BPCI\SumUp\OAuth\AccessToken;
7 7
 use BPCI\SumUp\Customer\CustomerInterface;
8 8
 
9
-interface CardClientInterface extends SumUpClientInterface{
9
+interface CardClientInterface extends SumUpClientInterface {
10 10
 
11 11
     /**
12 12
      * Create a new card resource and fill the $card Object with response.
Please login to merge, or discard this patch.
src/Customer/CustomerClient.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
                 'headers' => $headers
59 59
             ], $body);
60 60
             $successul = $response->getStatusCode() === 201;
61
-        } catch(\GuzzleHttp\Exception\RequestException $e){
61
+        } catch (\GuzzleHttp\Exception\RequestException $e) {
62 62
             throw new BadRequestException(
63 63
                 $e->getMessage(),
64 64
                 $e->getRequest(),
Please login to merge, or discard this patch.
src/Customer/Customer.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -135,10 +135,10 @@
 block discarded – undo
135 135
      */ 
136 136
     public function setAddress($address): CustomerInterface
137 137
     {
138
-        if($address instanceof AddressInterface)
138
+        if ($address instanceof AddressInterface)
139 139
         {
140 140
             $this->address = $address;
141
-        }else{
141
+        }else {
142 142
             $this->address = new Address($address);
143 143
         }
144 144
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@
 block discarded – undo
138 138
         if($address instanceof AddressInterface)
139 139
         {
140 140
             $this->address = $address;
141
-        }else{
141
+        } else{
142 142
             $this->address = new Address($address);
143 143
         }
144 144
 
Please login to merge, or discard this patch.
src/OAuth/AccessToken.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,12 +19,12 @@  discard block
 block discarded – undo
19 19
      * @param string $type
20 20
      * @param integer $expiresIn
21 21
      */
22
-    function __construct(string $token, string $type, int $expiresIn, string $scope = null){
22
+    function __construct(string $token, string $type, int $expiresIn, string $scope = null) {
23 23
         $this->token = $token;
24 24
         $this->type = $type;
25 25
         $this->expiration = time() + $expiresIn;
26 26
 
27
-        if($scope !== null) {
27
+        if ($scope !== null) {
28 28
             $this->scope = $scope;
29 29
         }
30 30
     }
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
      * @param string $scope[,$scope[,$scope[,...]]]
86 86
      * @return boolean
87 87
      */
88
-    function canAccess(string $scope){
88
+    function canAccess(string $scope) {
89 89
         $scopes = func_get_args();
90 90
         $diff = array_diff($scopes, $this->scope);
91
-        return count($diff)>0;
91
+        return count($diff) > 0;
92 92
     }
93 93
 }
Please login to merge, or discard this patch.