@@ -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; |
@@ -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 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | * @param string $column |
| 90 | 90 | * @param string $key |
| 91 | 91 | * |
| 92 | - * @return array |
|
| 92 | + * @return \Magister\Services\Support\Collection |
|
| 93 | 93 | */ |
| 94 | 94 | public function lists($column, $key = null) |
| 95 | 95 | { |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | * @param string $method |
| 167 | 167 | * @param array $parameters |
| 168 | 168 | * |
| 169 | - * @return mixed |
|
| 169 | + * @return Builder |
|
| 170 | 170 | */ |
| 171 | 171 | public function __call($method, $parameters) |
| 172 | 172 | { |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!function_exists('env')) { |
|
| 3 | +if ( ! function_exists('env')) { |
|
| 4 | 4 | /** |
| 5 | 5 | * Gets the value of an environment variable. Supports boolean, empty and null. |
| 6 | 6 | * |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | { |
| 22 | 22 | if ($app->auth->check()) { |
| 23 | 23 | // Temporary compatibility fix. |
| 24 | - if (!is_null($app->auth->user()) && is_null($app->auth->id())) { |
|
| 24 | + if ( ! is_null($app->auth->user()) && is_null($app->auth->id())) { |
|
| 25 | 25 | $app->config->replace('url', 'id', $app->auth->user()->Id); |
| 26 | 26 | } else { |
| 27 | 27 | $app->config->replace('url', 'id', $app->auth->id()); |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | public function process(Builder $builder, $results) |
| 21 | 21 | { |
| 22 | - if (!isset($results) || is_string($results) || isset($results['Fouttype'])) { |
|
| 22 | + if ( ! isset($results) || is_string($results) || isset($results['Fouttype'])) { |
|
| 23 | 23 | return []; |
| 24 | 24 | } |
| 25 | 25 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | foreach ($results as $result) { |
| 31 | - if (!is_array($result)) { |
|
| 31 | + if ( ! is_array($result)) { |
|
| 32 | 32 | return [$results]; |
| 33 | 33 | } |
| 34 | 34 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!function_exists('array_set')) { |
|
| 3 | +if ( ! function_exists('array_set')) { |
|
| 4 | 4 | /** |
| 5 | 5 | * Set an array item to a given value using dot notation. |
| 6 | 6 | * |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | while (count($keys) > 1) { |
| 22 | 22 | $key = array_shift($keys); |
| 23 | 23 | |
| 24 | - if (!isset($array[$key]) || !is_array($array[$key])) { |
|
| 24 | + if ( ! isset($array[$key]) || ! is_array($array[$key])) { |
|
| 25 | 25 | $array[$key] = []; |
| 26 | 26 | } |
| 27 | 27 | $array = &$array[$key]; |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | } |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | -if (!function_exists('array_get')) { |
|
| 35 | +if ( ! function_exists('array_get')) { |
|
| 36 | 36 | /** |
| 37 | 37 | * Get an item from an array using dot notation. |
| 38 | 38 | * |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | foreach (explode('.', $key) as $segment) { |
| 56 | - if (!is_array($array) || !array_key_exists($segment, $array)) { |
|
| 56 | + if ( ! is_array($array) || ! array_key_exists($segment, $array)) { |
|
| 57 | 57 | return $default; |
| 58 | 58 | } |
| 59 | 59 | $array = $array[$segment]; |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | -if (!function_exists('array_has')) { |
|
| 66 | +if ( ! function_exists('array_has')) { |
|
| 67 | 67 | /** |
| 68 | 68 | * Check if an item exists in an array using "dot" notation. |
| 69 | 69 | * |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | foreach (explode('.', $key) as $segment) { |
| 86 | - if (!is_array($array) || !array_key_exists($segment, $array)) { |
|
| 86 | + if ( ! is_array($array) || ! array_key_exists($segment, $array)) { |
|
| 87 | 87 | return false; |
| 88 | 88 | } |
| 89 | 89 | $array = $array[$segment]; |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | -if (!function_exists('array_first')) { |
|
| 96 | +if ( ! function_exists('array_first')) { |
|
| 97 | 97 | /** |
| 98 | 98 | * Return the first element in an array passing a given truth test. |
| 99 | 99 | * |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | -if (!function_exists('array_last')) { |
|
| 118 | +if ( ! function_exists('array_last')) { |
|
| 119 | 119 | /** |
| 120 | 120 | * Return the last element in an array passing a given truth test. |
| 121 | 121 | * |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | } |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | -if (!function_exists('array_flatten')) { |
|
| 134 | +if ( ! function_exists('array_flatten')) { |
|
| 135 | 135 | /** |
| 136 | 136 | * Flatten a multi-dimensional array into a single level. |
| 137 | 137 | * |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | { |
| 144 | 144 | $return = []; |
| 145 | 145 | |
| 146 | - array_walk_recursive($array, function ($x) use (&$return) { |
|
| 146 | + array_walk_recursive($array, function($x) use (&$return) { |
|
| 147 | 147 | $return[] = $x; |
| 148 | 148 | }); |
| 149 | 149 | |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | -if (!function_exists('array_pluck')) { |
|
| 154 | +if ( ! function_exists('array_pluck')) { |
|
| 155 | 155 | /** |
| 156 | 156 | * Pluck an array of values from an array. |
| 157 | 157 | * |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | } |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | -if (!function_exists('data_get')) { |
|
| 184 | +if ( ! function_exists('data_get')) { |
|
| 185 | 185 | /** |
| 186 | 186 | * Get an item from an array or object using "dot" notation. |
| 187 | 187 | * |
@@ -199,17 +199,17 @@ discard block |
||
| 199 | 199 | |
| 200 | 200 | foreach (explode('.', $key) as $segment) { |
| 201 | 201 | if (is_array($target)) { |
| 202 | - if (!array_key_exists($segment, $target)) { |
|
| 202 | + if ( ! array_key_exists($segment, $target)) { |
|
| 203 | 203 | return $default; |
| 204 | 204 | } |
| 205 | 205 | $target = $target[$segment]; |
| 206 | 206 | } elseif ($target instanceof ArrayAccess) { |
| 207 | - if (!isset($target[$segment])) { |
|
| 207 | + if ( ! isset($target[$segment])) { |
|
| 208 | 208 | return $default; |
| 209 | 209 | } |
| 210 | 210 | $target = $target[$segment]; |
| 211 | 211 | } elseif (is_object($target)) { |
| 212 | - if (!isset($target->{$segment})) { |
|
| 212 | + if ( ! isset($target->{$segment})) { |
|
| 213 | 213 | return $default; |
| 214 | 214 | } |
| 215 | 215 | $target = $target->{$segment}; |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | } |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | -if (!function_exists('starts_with')) { |
|
| 225 | +if ( ! function_exists('starts_with')) { |
|
| 226 | 226 | /** |
| 227 | 227 | * Determine if a given string starts with a given substring. |
| 228 | 228 | * |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | } |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | -if (!function_exists('ends_with')) { |
|
| 246 | +if ( ! function_exists('ends_with')) { |
|
| 247 | 247 | /** |
| 248 | 248 | * Determine if a given string ends with a given substring. |
| 249 | 249 | * |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | } |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | -if (!function_exists('snake_case')) { |
|
| 267 | +if ( ! function_exists('snake_case')) { |
|
| 268 | 268 | /** |
| 269 | 269 | * Convert a string to snake case. |
| 270 | 270 | * |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | */ |
| 276 | 276 | function snake_case($value, $delimiter = '_') |
| 277 | 277 | { |
| 278 | - if (!ctype_lower($value)) { |
|
| 278 | + if ( ! ctype_lower($value)) { |
|
| 279 | 279 | $value = strtolower(preg_replace('/(.)(?=[A-Z])/', '$1'.$delimiter, $value)); |
| 280 | 280 | } |
| 281 | 281 | |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | } |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | -if (!function_exists('camel_case')) { |
|
| 286 | +if ( ! function_exists('camel_case')) { |
|
| 287 | 287 | /** |
| 288 | 288 | * Convert a value to camel case. |
| 289 | 289 | * |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | } |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | -if (!function_exists('class_basename')) { |
|
| 302 | +if ( ! function_exists('class_basename')) { |
|
| 303 | 303 | /** |
| 304 | 304 | * Get the class "basename" of the given object / class. |
| 305 | 305 | * |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | } |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | -if (!function_exists('str_random')) { |
|
| 318 | +if ( ! function_exists('str_random')) { |
|
| 319 | 319 | /** |
| 320 | 320 | * Generate a more truly "random" alpha-numeric string. |
| 321 | 321 | * |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | } |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | -if (!function_exists('get_random_bytes')) { |
|
| 344 | +if ( ! function_exists('get_random_bytes')) { |
|
| 345 | 345 | /** |
| 346 | 346 | * Generate a more truly "random" bytes. |
| 347 | 347 | * |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | } |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | -if (!function_exists('with')) { |
|
| 372 | +if ( ! function_exists('with')) { |
|
| 373 | 373 | /** |
| 374 | 374 | * Return the given object. Useful for chaining. |
| 375 | 375 | * |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | protected function registerGuzzle() |
| 30 | 30 | { |
| 31 | - $this->app->singleton('http', function ($app) { |
|
| 31 | + $this->app->singleton('http', function($app) { |
|
| 32 | 32 | $client = new Client([ |
| 33 | 33 | 'base_url' => "https://{$app['school']}.magister.net/api/", |
| 34 | 34 | ]); |