@@ -65,7 +65,7 @@ |
||
| 65 | 65 | */ |
| 66 | 66 | public function register() |
| 67 | 67 | { |
| 68 | - if (!$this->isRegistered()) { |
|
| 68 | + if ( ! $this->isRegistered()) { |
|
| 69 | 69 | $this->registerAutoloader(); |
| 70 | 70 | |
| 71 | 71 | $this->registered = true; |
@@ -64,13 +64,13 @@ discard block |
||
| 64 | 64 | public function contains($key, $value = null) |
| 65 | 65 | { |
| 66 | 66 | if (func_num_args() == 2) { |
| 67 | - return $this->contains(function ($k, $item) use ($key, $value) { |
|
| 67 | + return $this->contains(function($k, $item) use ($key, $value) { |
|
| 68 | 68 | return data_get($item, $key) == $value; |
| 69 | 69 | }); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | if ($this->useAsCallable($key)) { |
| 73 | - return !is_null($this->first($key)); |
|
| 73 | + return ! is_null($this->first($key)); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | return in_array($key, $this->items); |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | */ |
| 130 | 130 | public function where($key, $value, $strict = true) |
| 131 | 131 | { |
| 132 | - return $this->filter(function ($item) use ($key, $value, $strict) { |
|
| 132 | + return $this->filter(function($item) use ($key, $value, $strict) { |
|
| 133 | 133 | return $strict ? data_get($item, $key) === $value : data_get($item, $key) == $value; |
| 134 | 134 | }); |
| 135 | 135 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | public function find($key, $default = null) |
| 159 | 159 | { |
| 160 | - return array_first($this->items, function ($itemKey, $model) use ($key) { |
|
| 160 | + return array_first($this->items, function($itemKey, $model) use ($key) { |
|
| 161 | 161 | return $itemKey == $key; |
| 162 | 162 | }, $default); |
| 163 | 163 | } |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | foreach ($this->items as $key => $value) { |
| 246 | 246 | $groupKey = $groupBy($value, $key); |
| 247 | 247 | |
| 248 | - if (!array_key_exists($groupKey, $results)) { |
|
| 248 | + if ( ! array_key_exists($groupKey, $results)) { |
|
| 249 | 249 | $results[$groupKey] = new static(); |
| 250 | 250 | } |
| 251 | 251 | |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | */ |
| 338 | 338 | protected function useAsCallable($value) |
| 339 | 339 | { |
| 340 | - return !is_string($value) && is_callable($value); |
|
| 340 | + return ! is_string($value) && is_callable($value); |
|
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | /** |
@@ -651,7 +651,7 @@ discard block |
||
| 651 | 651 | return $value; |
| 652 | 652 | } |
| 653 | 653 | |
| 654 | - return function ($item) use ($value) { |
|
| 654 | + return function($item) use ($value) { |
|
| 655 | 655 | return data_get($item, $value); |
| 656 | 656 | }; |
| 657 | 657 | } |
@@ -683,7 +683,7 @@ discard block |
||
| 683 | 683 | */ |
| 684 | 684 | public function toArray() |
| 685 | 685 | { |
| 686 | - return array_map(function ($value) { |
|
| 686 | + return array_map(function($value) { |
|
| 687 | 687 | return $value instanceof Arrayable ? $value->toArray() : $value; |
| 688 | 688 | }, $this->items); |
| 689 | 689 | } |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | { |
| 52 | 52 | $driver = $driver ?: $this->getDefaultDriver(); |
| 53 | 53 | |
| 54 | - if (!isset($this->drivers[$driver])) { |
|
| 54 | + if ( ! isset($this->drivers[$driver])) { |
|
| 55 | 55 | $this->drivers[$driver] = $this->createDriver($driver); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!function_exists('with')) { |
|
| 3 | +if ( ! function_exists('with')) { |
|
| 4 | 4 | /** |
| 5 | 5 | * Return the given object. Useful for chaining. |
| 6 | 6 | * |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | } |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | -if (!function_exists('array_set')) { |
|
| 17 | +if ( ! function_exists('array_set')) { |
|
| 18 | 18 | /** |
| 19 | 19 | * Set an array item to a given value using dot notation. |
| 20 | 20 | * |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | while (count($keys) > 1) { |
| 36 | 36 | $key = array_shift($keys); |
| 37 | 37 | |
| 38 | - if (!isset($array[$key]) || !is_array($array[$key])) { |
|
| 38 | + if ( ! isset($array[$key]) || ! is_array($array[$key])) { |
|
| 39 | 39 | $array[$key] = []; |
| 40 | 40 | } |
| 41 | 41 | $array = &$array[$key]; |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | -if (!function_exists('array_get')) { |
|
| 49 | +if ( ! function_exists('array_get')) { |
|
| 50 | 50 | /** |
| 51 | 51 | * Get an item from an array using dot notation. |
| 52 | 52 | * |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | foreach (explode('.', $key) as $segment) { |
| 70 | - if (!is_array($array) || !array_key_exists($segment, $array)) { |
|
| 70 | + if ( ! is_array($array) || ! array_key_exists($segment, $array)) { |
|
| 71 | 71 | return $default; |
| 72 | 72 | } |
| 73 | 73 | $array = $array[$segment]; |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | -if (!function_exists('array_has')) { |
|
| 80 | +if ( ! function_exists('array_has')) { |
|
| 81 | 81 | /** |
| 82 | 82 | * Check if an item exists in an array using "dot" notation. |
| 83 | 83 | * |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | foreach (explode('.', $key) as $segment) { |
| 100 | - if (!is_array($array) || !array_key_exists($segment, $array)) { |
|
| 100 | + if ( ! is_array($array) || ! array_key_exists($segment, $array)) { |
|
| 101 | 101 | return false; |
| 102 | 102 | } |
| 103 | 103 | $array = $array[$segment]; |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | -if (!function_exists('array_first')) { |
|
| 110 | +if ( ! function_exists('array_first')) { |
|
| 111 | 111 | /** |
| 112 | 112 | * Return the first element in an array passing a given truth test. |
| 113 | 113 | * |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | -if (!function_exists('array_last')) { |
|
| 132 | +if ( ! function_exists('array_last')) { |
|
| 133 | 133 | /** |
| 134 | 134 | * Return the last element in an array passing a given truth test. |
| 135 | 135 | * |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | } |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | -if (!function_exists('array_flatten')) { |
|
| 148 | +if ( ! function_exists('array_flatten')) { |
|
| 149 | 149 | /** |
| 150 | 150 | * Flatten a multi-dimensional array into a single level. |
| 151 | 151 | * |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | { |
| 158 | 158 | $return = []; |
| 159 | 159 | |
| 160 | - array_walk_recursive($array, function ($x) use (&$return) { |
|
| 160 | + array_walk_recursive($array, function($x) use (&$return) { |
|
| 161 | 161 | $return[] = $x; |
| 162 | 162 | }); |
| 163 | 163 | |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | -if (!function_exists('array_pluck')) { |
|
| 168 | +if ( ! function_exists('array_pluck')) { |
|
| 169 | 169 | /** |
| 170 | 170 | * Pluck an array of values from an array. |
| 171 | 171 | * |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | } |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | -if (!function_exists('data_get')) { |
|
| 198 | +if ( ! function_exists('data_get')) { |
|
| 199 | 199 | /** |
| 200 | 200 | * Get an item from an array or object using "dot" notation. |
| 201 | 201 | * |
@@ -213,17 +213,17 @@ discard block |
||
| 213 | 213 | |
| 214 | 214 | foreach (explode('.', $key) as $segment) { |
| 215 | 215 | if (is_array($target)) { |
| 216 | - if (!array_key_exists($segment, $target)) { |
|
| 216 | + if ( ! array_key_exists($segment, $target)) { |
|
| 217 | 217 | return $default; |
| 218 | 218 | } |
| 219 | 219 | $target = $target[$segment]; |
| 220 | 220 | } elseif ($target instanceof ArrayAccess) { |
| 221 | - if (!isset($target[$segment])) { |
|
| 221 | + if ( ! isset($target[$segment])) { |
|
| 222 | 222 | return $default; |
| 223 | 223 | } |
| 224 | 224 | $target = $target[$segment]; |
| 225 | 225 | } elseif (is_object($target)) { |
| 226 | - if (!isset($target->{$segment})) { |
|
| 226 | + if ( ! isset($target->{$segment})) { |
|
| 227 | 227 | return $default; |
| 228 | 228 | } |
| 229 | 229 | $target = $target->{$segment}; |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | } |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | -if (!function_exists('starts_with')) { |
|
| 239 | +if ( ! function_exists('starts_with')) { |
|
| 240 | 240 | /** |
| 241 | 241 | * Determine if a given string starts with a given substring. |
| 242 | 242 | * |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | } |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | -if (!function_exists('snake_case')) { |
|
| 260 | +if ( ! function_exists('snake_case')) { |
|
| 261 | 261 | /** |
| 262 | 262 | * Convert a string to snake case. |
| 263 | 263 | * |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | */ |
| 269 | 269 | function snake_case($value, $delimiter = '_') |
| 270 | 270 | { |
| 271 | - if (!ctype_lower($value)) { |
|
| 271 | + if ( ! ctype_lower($value)) { |
|
| 272 | 272 | $value = strtolower(preg_replace('/(.)(?=[A-Z])/', '$1'.$delimiter, $value)); |
| 273 | 273 | } |
| 274 | 274 | |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | } |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | -if (!function_exists('camel_case')) { |
|
| 279 | +if ( ! function_exists('camel_case')) { |
|
| 280 | 280 | /** |
| 281 | 281 | * Convert a value to camel case. |
| 282 | 282 | * |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | } |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | -if (!function_exists('class_basename')) { |
|
| 295 | +if ( ! function_exists('class_basename')) { |
|
| 296 | 296 | /** |
| 297 | 297 | * Get the class "basename" of the given object / class. |
| 298 | 298 | * |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | } |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | -if (!function_exists('str_random')) { |
|
| 311 | +if ( ! function_exists('str_random')) { |
|
| 312 | 312 | /** |
| 313 | 313 | * Generate a more truly "random" alpha-numeric string. |
| 314 | 314 | * |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | } |
| 335 | 335 | } |
| 336 | 336 | |
| 337 | -if (!function_exists('get_random_bytes')) { |
|
| 337 | +if ( ! function_exists('get_random_bytes')) { |
|
| 338 | 338 | /** |
| 339 | 339 | * Generate a more truly "random" bytes. |
| 340 | 340 | * |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | } |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | -if (!function_exists('process')) { |
|
| 365 | +if ( ! function_exists('process')) { |
|
| 366 | 366 | /** |
| 367 | 367 | * Process the selected results. |
| 368 | 368 | * |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | */ |
| 373 | 373 | function process($results) |
| 374 | 374 | { |
| 375 | - if (!isset($results) || isset($results['Fouttype'])) { |
|
| 375 | + if ( ! isset($results) || isset($results['Fouttype'])) { |
|
| 376 | 376 | return []; |
| 377 | 377 | } |
| 378 | 378 | |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | foreach ($results as $result) { |
| 384 | - if (!is_array($result)) { |
|
| 384 | + if ( ! is_array($result)) { |
|
| 385 | 385 | return [$results]; |
| 386 | 386 | } |
| 387 | 387 | } |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | } |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | -if (!function_exists('translate')) { |
|
| 393 | +if ( ! function_exists('translate')) { |
|
| 394 | 394 | /** |
| 395 | 395 | * Return the translation for the foreign. |
| 396 | 396 | * |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | { |
| 403 | 403 | $translator = \App::make('translator'); |
| 404 | 404 | |
| 405 | - if (!$translator->from($model)->hasTranslation($foreign)) { |
|
| 405 | + if ( ! $translator->from($model)->hasTranslation($foreign)) { |
|
| 406 | 406 | return $foreign; |
| 407 | 407 | } |
| 408 | 408 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | public function from($model) |
| 40 | 40 | { |
| 41 | - if (!isset($this->getDictionary()[$model])) { |
|
| 41 | + if ( ! isset($this->getDictionary()[$model])) { |
|
| 42 | 42 | throw new \InvalidArgumentException(sprintf('Could not find translations for the model: "%s" in the dictionary.', $model)); |
| 43 | 43 | } |
| 44 | 44 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | { |
| 73 | 73 | $model = $this->getModel($model); |
| 74 | 74 | |
| 75 | - if (!$this->hasTranslation($foreign, $model)) { |
|
| 75 | + if ( ! $this->hasTranslation($foreign, $model)) { |
|
| 76 | 76 | throw new TranslationNotFoundException('The foreign word that had to be translated could not be found in the dictionary!'); |
| 77 | 77 | } |
| 78 | 78 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public function getModel($model = null) |
| 102 | 102 | { |
| 103 | - if (!is_null($this->model)) { |
|
| 103 | + if ( ! is_null($this->model)) { |
|
| 104 | 104 | return $this->model; |
| 105 | 105 | } |
| 106 | 106 | |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | */ |
| 50 | 50 | protected function registerPrettyWhoopsHandler() |
| 51 | 51 | { |
| 52 | - $this->app['whoops.handler'] = $this->app->share(function () { |
|
| 52 | + $this->app['whoops.handler'] = $this->app->share(function() { |
|
| 53 | 53 | with($handler = new PrettyPageHandler)->setEditor('sublime'); |
| 54 | 54 | |
| 55 | 55 | return $handler; |