@@ -14,13 +14,13 @@ discard block |
||
14 | 14 | * @param string $class The fully-qualified class name. |
15 | 15 | * @return void |
16 | 16 | */ |
17 | -spl_autoload_register(function ($class) { |
|
17 | +spl_autoload_register(function($class) { |
|
18 | 18 | |
19 | 19 | // project-specific namespace prefix |
20 | 20 | $prefix = 'Everypay\\'; |
21 | 21 | |
22 | 22 | // base directory for the namespace prefix |
23 | - $base_dir = __DIR__ . '/src/'; |
|
23 | + $base_dir = __DIR__.'/src/'; |
|
24 | 24 | |
25 | 25 | // does the class use the namespace prefix? |
26 | 26 | $len = strlen($prefix); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | // replace the namespace prefix with the base directory, replace namespace |
36 | 36 | // separators with directory separators in the relative class name, append |
37 | 37 | // with .php |
38 | - $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; |
|
38 | + $file = $base_dir.str_replace('\\', '/', $relative_class).'.php'; |
|
39 | 39 | |
40 | 40 | // if the file exists, require it |
41 | 41 | if (file_exists($file)) { |
@@ -45,7 +45,7 @@ |
||
45 | 45 | foreach ($extensions as $extension) { |
46 | 46 | if (!extension_loaded($extension)) { |
47 | 47 | throw new Exception\RuntimeException( |
48 | - 'You need the PHP ' . $extension |
|
48 | + 'You need the PHP '.$extension |
|
49 | 49 | . ' extension in order to use EveryPay PHP Library' |
50 | 50 | ); |
51 | 51 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | $uri = parent::getResourceUri(); |
24 | 24 | |
25 | 25 | if (!empty($this->params)) { |
26 | - $uri .= '?' . http_build_query($this->params, null, '&'); |
|
26 | + $uri .= '?'.http_build_query($this->params, null, '&'); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | return $uri; |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | |
49 | 49 | $pass = $parts['pass']; |
50 | 50 | |
51 | - $this->user = $user . ($pass ? ':'.$pass : null); |
|
51 | + $this->user = $user.($pass ? ':'.$pass : null); |
|
52 | 52 | |
53 | - $this->path = ((strlen($parts['path'])-1) == strrpos($parts['path'], '/') ? substr($parts['path'],0,-1) : $parts['path']); |
|
53 | + $this->path = ((strlen($parts['path'])-1) == strrpos($parts['path'], '/') ? substr($parts['path'], 0, -1) : $parts['path']); |
|
54 | 54 | |
55 | 55 | $this->query = $parts['query']; |
56 | 56 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | { |
92 | 92 | $info = $user; |
93 | 93 | if ($password) { |
94 | - $info .= ':' . $password; |
|
94 | + $info .= ':'.$password; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | if ($info === $this->user) { |
@@ -179,11 +179,11 @@ discard block |
||
179 | 179 | if (null !== $this->uriString) { |
180 | 180 | return $this->uriString; |
181 | 181 | } |
182 | - $this->uriString = $this->scheme . "://" . |
|
183 | - $this->host . |
|
184 | - ($this->port ? ":".$this->port : null) . |
|
185 | - ($this->path ?: null) . |
|
186 | - ($this->query ? "?".$this->query : null) . |
|
182 | + $this->uriString = $this->scheme."://". |
|
183 | + $this->host. |
|
184 | + ($this->port ? ":".$this->port : null). |
|
185 | + ($this->path ?: null). |
|
186 | + ($this->query ? "?".$this->query : null). |
|
187 | 187 | ($this->fragment ? "#".$this->fragment : null); |
188 | 188 | |
189 | 189 | return $this->uriString; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | public function __construct(array $options = array()) |
37 | 37 | { |
38 | - $this->options = $this->options + $options; |
|
38 | + $this->options = $this->options+$options; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $info = curl_getinfo($handler); |
58 | 58 | |
59 | 59 | if (false === $result) { |
60 | - $error = curl_error($handler); |
|
60 | + $error = curl_error($handler); |
|
61 | 61 | $errno = curl_errno($handler); |
62 | 62 | curl_close($handler); |
63 | 63 | throw new CurlException($error, $errno); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | $headerArray = array(); |
117 | 117 | $parts = explode($newLine, $headers); |
118 | - array_walk($parts, function (&$part) { |
|
118 | + array_walk($parts, function(&$part) { |
|
119 | 119 | $part = trim(substr($part, 0, -1)); |
120 | 120 | }); |
121 | 121 | $headers = array_filter($parts, 'strlen'); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $headers = array(); |
134 | 134 | |
135 | 135 | foreach ($request->getHeaders() as $name => $values) { |
136 | - $headers[] = $name . ': ' . implode(", ", $values); |
|
136 | + $headers[] = $name.': '.implode(", ", $values); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | $this->options[CURLOPT_HTTPHEADER] = $headers; |
@@ -182,8 +182,8 @@ discard block |
||
182 | 182 | . '://' |
183 | 183 | . $uri->getHost() |
184 | 184 | . $uri->getPath() |
185 | - . ($uri->getQuery() ? '?' . $uri->getQuery() : null) |
|
186 | - . ($uri->getFragment() ? '#' . $uri->getFragment() : null); |
|
185 | + . ($uri->getQuery() ? '?'.$uri->getQuery() : null) |
|
186 | + . ($uri->getFragment() ? '#'.$uri->getFragment() : null); |
|
187 | 187 | |
188 | 188 | $this->options[CURLOPT_PORT] = $port; |
189 | 189 | $this->options[CURLOPT_URL] = $url; |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | public static function delete($token, array $params = array()) |
39 | 39 | { |
40 | 40 | throw new Exception\RuntimeException( |
41 | - 'Resource ' . ucfirst(static::RESOURCE_NAME) . |
|
42 | - ' does not support method ' . __METHOD__ |
|
41 | + 'Resource '.ucfirst(static::RESOURCE_NAME). |
|
42 | + ' does not support method '.__METHOD__ |
|
43 | 43 | ); |
44 | 44 | } |
45 | 45 | |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | public static function update($token, array $params) |
54 | 54 | { |
55 | 55 | throw new Exception\RuntimeException( |
56 | - 'Resource ' . ucfirst(static::RESOURCE_NAME) . |
|
57 | - ' does not support method ' . __METHOD__ |
|
56 | + 'Resource '.ucfirst(static::RESOURCE_NAME). |
|
57 | + ' does not support method '.__METHOD__ |
|
58 | 58 | ); |
59 | 59 | } |
60 | 60 | } |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | ); |
140 | 140 | |
141 | 141 | $options = array_merge($params, $options); |
142 | - $actionClass = 'Everypay\\Action\\' . (ucwords($action)); |
|
142 | + $actionClass = 'Everypay\\Action\\'.(ucwords($action)); |
|
143 | 143 | $actionInstance = new $actionClass($options); |
144 | 144 | $request = $actionInstance(); |
145 | 145 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $client = self::$client ?: new CurlClient(self::$clientOptions); |
152 | 152 | $client->setOption(CurlClient::TIMEOUT, 30); |
153 | 153 | $client->setOption(CurlClient::SSL_VERIFY_PEER, 0); |
154 | - $client->setOption(CurlClient::USER_AGENT, 'EveryPay PHP Library ' . Everypay::VERSION); |
|
154 | + $client->setOption(CurlClient::USER_AGENT, 'EveryPay PHP Library '.Everypay::VERSION); |
|
155 | 155 | $client->setOption(CurlClient::SSL_VERSION, CURL_SSLVERSION_TLSv1_2); |
156 | 156 | |
157 | 157 | return $client; |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | public static function listAll(array $params = array()) |
45 | 45 | { |
46 | 46 | throw new Exception\RuntimeException( |
47 | - 'Resource ' . ucfirst(static::RESOURCE_NAME) . |
|
48 | - ' does not support method ' . __METHOD__ |
|
47 | + 'Resource '.ucfirst(static::RESOURCE_NAME). |
|
48 | + ' does not support method '.__METHOD__ |
|
49 | 49 | ); |
50 | 50 | } |
51 | 51 | |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | public static function update($token, array $params) |
59 | 59 | { |
60 | 60 | throw new Exception\RuntimeException( |
61 | - 'Resource ' . ucfirst(static::RESOURCE_NAME) . |
|
62 | - ' does not support method ' . __METHOD__ |
|
61 | + 'Resource '.ucfirst(static::RESOURCE_NAME). |
|
62 | + ' does not support method '.__METHOD__ |
|
63 | 63 | ); |
64 | 64 | } |
65 | 65 | |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | public static function delete($token, array $params = array()) |
72 | 72 | { |
73 | 73 | throw new Exception\RuntimeException( |
74 | - 'Resource ' . ucfirst(static::RESOURCE_NAME) . |
|
75 | - ' does not support method ' . __METHOD__ |
|
74 | + 'Resource '.ucfirst(static::RESOURCE_NAME). |
|
75 | + ' does not support method '.__METHOD__ |
|
76 | 76 | ); |
77 | 77 | } |
78 | 78 | } |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | public static function delete($token, array $params = array()) |
39 | 39 | { |
40 | 40 | throw new Exception\RuntimeException( |
41 | - 'Resource ' . ucfirst(static::RESOURCE_NAME) . |
|
42 | - ' does not support method ' . __METHOD__ |
|
41 | + 'Resource '.ucfirst(static::RESOURCE_NAME). |
|
42 | + ' does not support method '.__METHOD__ |
|
43 | 43 | ); |
44 | 44 | } |
45 | 45 | |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | public static function update($token, array $params) |
54 | 54 | { |
55 | 55 | throw new Exception\RuntimeException( |
56 | - 'Resource ' . ucfirst(static::RESOURCE_NAME) . |
|
57 | - ' does not support method ' . __METHOD__ |
|
56 | + 'Resource '.ucfirst(static::RESOURCE_NAME). |
|
57 | + ' does not support method '.__METHOD__ |
|
58 | 58 | ); |
59 | 59 | } |
60 | 60 | } |