@@ -21,9 +21,9 @@ |
||
21 | 21 | | |
22 | 22 | */ |
23 | 23 | |
24 | - 'driver' => 'array_response', |
|
24 | + 'driver' => 'array_response', |
|
25 | 25 | |
26 | - /* |
|
26 | + /* |
|
27 | 27 | |-------------------------------------------------------------------------- |
28 | 28 | | API Errors Key |
29 | 29 | |-------------------------------------------------------------------------- |
@@ -29,9 +29,9 @@ |
||
29 | 29 | | |
30 | 30 | */ |
31 | 31 | |
32 | - 'driver' => 'rest', |
|
32 | + 'driver' => 'rest', |
|
33 | 33 | |
34 | - /* |
|
34 | + /* |
|
35 | 35 | |-------------------------------------------------------------------------- |
36 | 36 | | HTTP method request parameter |
37 | 37 | |-------------------------------------------------------------------------- |
@@ -16,9 +16,9 @@ |
||
16 | 16 | | |
17 | 17 | */ |
18 | 18 | |
19 | - 'driver' => 'http_status_code', |
|
19 | + 'driver' => 'http_status_code', |
|
20 | 20 | |
21 | - /* |
|
21 | + /* |
|
22 | 22 | |-------------------------------------------------------------------------- |
23 | 23 | | HTTP Status Codes |
24 | 24 | |-------------------------------------------------------------------------- |
@@ -216,7 +216,7 @@ |
||
216 | 216 | $request = $this->request; |
217 | 217 | $this->request->getEventDispatcher()->addListener( |
218 | 218 | 'request.error', |
219 | - function (Event $event) use ($httpStatus, $stopPropagation, $func, $request) { |
|
219 | + function(Event $event) use ($httpStatus, $stopPropagation, $func, $request) { |
|
220 | 220 | if ($httpStatus == -1 || $event['response']->getStatusCode() == $httpStatus) { |
221 | 221 | // Stop other events from firing if needed |
222 | 222 | if ($stopPropagation) { |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | $ext = end($mimeExp); |
336 | 336 | $output_file = implode( |
337 | 337 | DIRECTORY_SEPARATOR, |
338 | - [$this->getScratchDiskLocation(), uniqid("tmp_{$property}_", true) . ".$ext"] |
|
338 | + [$this->getScratchDiskLocation(), uniqid("tmp_{$property}_", true).".$ext"] |
|
339 | 339 | ); |
340 | 340 | $f = fopen($output_file, 'wb'); |
341 | 341 | fwrite($f, $image); |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | Config::get('request.base_uri'), |
517 | 517 | UrlGenerator::getDeleteUri( |
518 | 518 | $this, |
519 | - [':' . $this->getIdentityProperty() => $this->getId()] |
|
519 | + [':'.$this->getIdentityProperty() => $this->getId()] |
|
520 | 520 | ), |
521 | 521 | 'PUT', |
522 | 522 | [], //no extra headers |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | Config::get('request.base_uri'), |
578 | 578 | UrlGenerator::getDeleteUri( |
579 | 579 | $this, |
580 | - [':' . $this->getIdentityProperty() => $this->getId()] |
|
580 | + [':'.$this->getIdentityProperty() => $this->getId()] |
|
581 | 581 | ), |
582 | 582 | 'DELETE', |
583 | 583 | [], //no extra headers |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | { |
94 | 94 | $quoted = preg_quote($cap, '/'); |
95 | 95 | |
96 | - return preg_replace('/(?:' . $quoted . ')+$/', '', $value) . $cap; |
|
96 | + return preg_replace('/(?:'.$quoted.')+$/', '', $value).$cap; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -115,9 +115,9 @@ discard block |
||
115 | 115 | // Asterisks are translated into zero-or-more regular expression wildcards |
116 | 116 | // to make it convenient to check if the strings starts with the given |
117 | 117 | // pattern such as "library/*", making any string check convenient. |
118 | - $pattern = str_replace('\*', '.*', $pattern) . '\z'; |
|
118 | + $pattern = str_replace('\*', '.*', $pattern).'\z'; |
|
119 | 119 | |
120 | - return (bool) preg_match('#^' . $pattern . '#', $value); |
|
120 | + return (bool) preg_match('#^'.$pattern.'#', $value); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | return $value; |
148 | 148 | } |
149 | 149 | |
150 | - return rtrim(mb_substr($value, 0, $limit, 'UTF-8')) . $end; |
|
150 | + return rtrim(mb_substr($value, 0, $limit, 'UTF-8')).$end; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | */ |
174 | 174 | public static function words($value, $words = 100, $end = '...') |
175 | 175 | { |
176 | - preg_match('/^\s*+(?:\S++\s*+){1,' . $words . '}/u', $value, $matches); |
|
176 | + preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $value, $matches); |
|
177 | 177 | |
178 | 178 | if (!isset($matches[0])) { |
179 | 179 | return $value; |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | return $value; |
184 | 184 | } |
185 | 185 | |
186 | - return rtrim($matches[0]) . $end; |
|
186 | + return rtrim($matches[0]).$end; |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | /** |
@@ -303,13 +303,13 @@ discard block |
||
303 | 303 | // Convert all dashes/undescores into separator |
304 | 304 | $flip = '-' == $separator ? '_' : '-'; |
305 | 305 | |
306 | - $title = preg_replace('![' . preg_quote($flip) . ']+!u', $separator, $title); |
|
306 | + $title = preg_replace('!['.preg_quote($flip).']+!u', $separator, $title); |
|
307 | 307 | |
308 | 308 | // Remove all characters that are not the separator, letters, numbers, or whitespace. |
309 | - $title = preg_replace('![^' . preg_quote($separator) . '\pL\pN\s]+!u', '', mb_strtolower($title)); |
|
309 | + $title = preg_replace('![^'.preg_quote($separator).'\pL\pN\s]+!u', '', mb_strtolower($title)); |
|
310 | 310 | |
311 | 311 | // Replace all separator characters and whitespace by a single separator |
312 | - $title = preg_replace('![' . preg_quote($separator) . '\s]+!u', $separator, $title); |
|
312 | + $title = preg_replace('!['.preg_quote($separator).'\s]+!u', $separator, $title); |
|
313 | 313 | |
314 | 314 | return trim($title, $separator); |
315 | 315 | } |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | */ |
325 | 325 | public static function snake($value, $delimiter = '_') |
326 | 326 | { |
327 | - $replace = '$1' . $delimiter . '$2'; |
|
327 | + $replace = '$1'.$delimiter.'$2'; |
|
328 | 328 | |
329 | 329 | return ctype_lower($value) ? $value : strtolower(preg_replace('/(.)([A-Z])/', $replace, $value)); |
330 | 330 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function get($option) |
54 | 54 | { |
55 | - return $this->app['config']->get('trucker::' . $option); |
|
55 | + return $this->app['config']->get('trucker::'.$option); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function set($option, $value) |
67 | 67 | { |
68 | - return $this->app['config']->set('trucker::' . $option, $value); |
|
68 | + return $this->app['config']->set('trucker::'.$option, $value); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | $uriResult = []; |
145 | 145 | if (!empty($model->nestedUnder)) { |
146 | 146 | $nesting = array_map( |
147 | - function ($item) { |
|
147 | + function($item) { |
|
148 | 148 | return explode(':', trim($item)); |
149 | 149 | }, |
150 | 150 | explode(',', $model->nestedUnder) |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $uriResult[] = $entityTypeSegment; |
160 | 160 | $uriResult[] = $entityIdSegment; |
161 | 161 | } |
162 | - $uri = implode('/', $uriResult) . "/$uri"; |
|
162 | + $uri = implode('/', $uriResult)."/$uri"; |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | return "/$uri"; |
@@ -122,7 +122,7 @@ |
||
122 | 122 | */ |
123 | 123 | public function last() |
124 | 124 | { |
125 | - return empty($this->collection) ? null : $this->collection[count($this->collection) - 1]; |
|
125 | + return empty($this->collection) ? null : $this->collection[count($this->collection)-1]; |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |