Passed
Pull Request — master (#4)
by
unknown
03:22
created
src/Utils/ArrayUtil.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
      */
21 21
     public static function searchAndReplace($search, $replace, $haystack)
22 22
     {
23
-        $callback = function (&$value, $key, array $params) {
23
+        $callback = function(&$value, $key, array $params) {
24 24
             if (($params['search'] === $value)) {
25 25
                 $value = $params['replace'];
26 26
             }
Please login to merge, or discard this patch.
src/Exception/ErrorCodeException.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
     {
21 21
         parent::__construct($message);
22 22
 
23
-        $this->message .= '. Server response: '.$response;
24
-        $this->message .= '. Url: '.$url;
23
+        $this->message .= '. Server response: ' . $response;
24
+        $this->message .= '. Url: ' . $url;
25 25
     }
26 26
 }
Please login to merge, or discard this patch.
src/Exception/FailedAuthException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,6 +19,6 @@
 block discarded – undo
19 19
     {
20 20
         parent::__construct($message);
21 21
 
22
-        $this->message .= '. Server response: '.$response;
22
+        $this->message .= '. Server response: ' . $response;
23 23
     }
24 24
 }
Please login to merge, or discard this patch.
src/Validator/FieldsValidator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     private function prepareValidateType($key)
66 66
     {
67 67
         $key = str_replace('|', '', $key);
68
-        $method = 'validate'.ucfirst($key);
68
+        $method = 'validate' . ucfirst($key);
69 69
         if (!method_exists(self::class, $method)) {
70 70
             throw new EntityFieldsException(
71 71
                 "Internal error: the field \"$key\" doesn't match any of the entity predefined fields"
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
     private function validateRequired($key, $value)
87 87
     {
88 88
         if (('add' === $this->action) || ('update' === $this->action)) {
89
-            if (!isset($value) && (true === $this->fieldsParams[$key]['required_'.$this->action])) {
90
-                throw new EntityFieldsException(ucfirst($this->action)." error: the required field \"$key\" is missing or empty");
89
+            if (!isset($value) && (true === $this->fieldsParams[$key]['required_' . $this->action])) {
90
+                throw new EntityFieldsException(ucfirst($this->action) . " error: the required field \"$key\" is missing or empty");
91 91
             }
92 92
         }
93 93
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
      */
107 107
     private static function validateInt($key, $value)
108 108
     {
109
-        if (!is_int($value) || !preg_match('/^\d+$/', (string) $value)) {
109
+        if (!is_int($value) || !preg_match('/^\d+$/', (string)$value)) {
110 110
             throw new EntityFieldsException("The field \"$key\" must contain digits only");
111 111
         }
112 112
 
Please login to merge, or discard this patch.
src/Client.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@
 block discarded – undo
131 131
             $result = $this->dataSender->send($this->urlBuilder->buildMethodUrl('auth'), $this->credentials->getCredentials());
132 132
 
133 133
             if (!empty($result) && (!file_exists($this->settings->getCookiePath()))) {
134
-                $message = 'An error occurred while creating the cookie file '.$this->settings->getCookiePath();
134
+                $message = 'An error occurred while creating the cookie file ' . $this->settings->getCookiePath();
135 135
                 throw new RuntimeException($message);
136 136
             }
137 137
         }
Please login to merge, or discard this patch.
src/Utils/StringUtil.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
      */
17 17
     public static function isAlNum($value)
18 18
     {
19
-        if (!self::isCorrectType($value) || !ctype_alnum((string) $value)) {
19
+        if (!self::isCorrectType($value) || !ctype_alnum((string)$value)) {
20 20
             return false;
21 21
         }
22 22
 
Please login to merge, or discard this patch.
src/Request/DataSender.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         $this->curl->close();
65 65
         $this->validateCode($code, $url, $response);
66 66
 
67
-        return (string) $response;
67
+        return (string)$response;
68 68
     }
69 69
 
70 70
     /**
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
             504 => '504 Gateway Timeout',
88 88
         ];
89 89
 
90
-        return isset($errors[$code]) ? $errors[$code] : $code.' Unknown error';
90
+        return isset($errors[$code]) ? $errors[$code] : $code . ' Unknown error';
91 91
     }
92 92
 
93 93
     /**
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         switch ($code) {
106 106
             case 401:
107 107
             case 403:
108
-                throw new FailedAuthException('Auth failed! '.self::getErrorByHttpCode($code), $response);
108
+                throw new FailedAuthException('Auth failed! ' . self::getErrorByHttpCode($code), $response);
109 109
                 break;
110 110
             case 200 !== $code && 204 !== $code:
111 111
                 throw new ErrorCodeException(self::getErrorByHttpCode($code), $response, $url);
Please login to merge, or discard this patch.
src/Request/UrlBuilder.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         if (!empty($params)) {
47 47
             $query = '?';
48 48
             foreach ($params as $key => $param) {
49
-                $query .= $key.'='.$param;
49
+                $query .= $key . '=' . $param;
50 50
 
51 51
                 if ($param !== end($params)) {
52 52
                     $query .= '&';
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             }
55 55
         }
56 56
 
57
-        $result = isset($query) ? $host.$path.$query : $host.$path;
57
+        $result = isset($query) ? $host . $path . $query : $host . $path;
58 58
 
59 59
         return $result;
60 60
     }
@@ -66,6 +66,6 @@  discard block
 block discarded – undo
66 66
      */
67 67
     private function makeUserHost($subdomain)
68 68
     {
69
-        return $this->settings->getScheme().'://'.$subdomain.'.'.$this->settings->getDomain();
69
+        return $this->settings->getScheme() . '://' . $subdomain . '.' . $this->settings->getDomain();
70 70
     }
71 71
 }
Please login to merge, or discard this patch.
src/Model/ModelFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
      */
46 46
     private function prepareClassName($name)
47 47
     {
48
-        return SettingsStorage::NAMESPACE_PREFIX.'\Model\Amo\\'.rtrim(ucfirst($name), 's');
48
+        return SettingsStorage::NAMESPACE_PREFIX . '\Model\Amo\\' . rtrim(ucfirst($name), 's');
49 49
     }
50 50
 
51 51
     /**
Please login to merge, or discard this patch.