@@ -44,7 +44,7 @@ |
||
| 44 | 44 | /** |
| 45 | 45 | * Define a relationship. |
| 46 | 46 | * |
| 47 | - * @return mixed |
|
| 47 | + * @return \Magister\Services\Database\Elegant\Relations\HasMany |
|
| 48 | 48 | */ |
| 49 | 49 | public function counsellors() |
| 50 | 50 | { |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | /** |
| 154 | 154 | * Determine if the user matches the credentials. |
| 155 | 155 | * |
| 156 | - * @param mixed $user |
|
| 156 | + * @param \Magister\Services\Database\Elegant\Model|null $user |
|
| 157 | 157 | * |
| 158 | 158 | * @return bool |
| 159 | 159 | */ |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | /** |
| 287 | 287 | * Return the currently cached user. |
| 288 | 288 | * |
| 289 | - * @return mixed|null |
|
| 289 | + * @return UserContract |
|
| 290 | 290 | */ |
| 291 | 291 | public function getUser() |
| 292 | 292 | { |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | public function check() |
| 67 | 67 | { |
| 68 | - return !is_null($this->user()); |
|
| 68 | + return ! is_null($this->user()); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function guest() |
| 77 | 77 | { |
| 78 | - return !$this->check(); |
|
| 78 | + return ! $this->check(); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | // If we have already retrieved the user for the current request we can just |
| 93 | 93 | // return it back immediately. We do not want to pull the user data every |
| 94 | 94 | // request into the method because that would tremendously slow an app. |
| 95 | - if (!is_null($this->user)) { |
|
| 95 | + if ( ! is_null($this->user)) { |
|
| 96 | 96 | return $this->user; |
| 97 | 97 | } |
| 98 | 98 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | $user = null; |
| 102 | 102 | |
| 103 | - if (!is_null($id)) { |
|
| 103 | + if ( ! is_null($id)) { |
|
| 104 | 104 | $user = $this->provider->retrieveByToken(); |
| 105 | 105 | } |
| 106 | 106 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | protected function hasValidCredentials($user) |
| 161 | 161 | { |
| 162 | - return !is_null($user); |
|
| 162 | + return ! is_null($user); |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | /** |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | */ |
| 315 | 315 | public function getCookieJar() |
| 316 | 316 | { |
| 317 | - if (!isset($this->cookie)) { |
|
| 317 | + if ( ! isset($this->cookie)) { |
|
| 318 | 318 | throw new \RuntimeException('Cookie jar has not been set.'); |
| 319 | 319 | } |
| 320 | 320 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * Register a service as a singleton. |
| 37 | 37 | * |
| 38 | 38 | * @param string $abstract |
| 39 | - * @param mixed $concrete |
|
| 39 | + * @param Closure $concrete |
|
| 40 | 40 | * |
| 41 | 41 | * @return void |
| 42 | 42 | */ |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | * |
| 210 | 210 | * @param string $abstract |
| 211 | 211 | * |
| 212 | - * @return bool |
|
| 212 | + * @return boolean|null |
|
| 213 | 213 | */ |
| 214 | 214 | public function __isset($abstract) |
| 215 | 215 | { |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | * |
| 259 | 259 | * @param string $abstract |
| 260 | 260 | * |
| 261 | - * @return bool |
|
| 261 | + * @return boolean|null |
|
| 262 | 262 | */ |
| 263 | 263 | public function offsetExists($abstract) |
| 264 | 264 | { |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | public function make($abstract) |
| 58 | 58 | { |
| 59 | - if (!$this->bound($abstract)) { |
|
| 59 | + if ( ! $this->bound($abstract)) { |
|
| 60 | 60 | throw new InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $abstract)); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | public static function share(Closure $callable) |
| 101 | 101 | { |
| 102 | - return function ($c) use ($callable) { |
|
| 102 | + return function($c) use ($callable) { |
|
| 103 | 103 | static $object; |
| 104 | 104 | |
| 105 | 105 | if (null === $object) { |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | public static function protect(Closure $callable) |
| 121 | 121 | { |
| 122 | - return function ($c) use ($callable) { |
|
| 122 | + return function($c) use ($callable) { |
|
| 123 | 123 | return $callable; |
| 124 | 124 | }; |
| 125 | 125 | } |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | */ |
| 136 | 136 | public function raw($abstract) |
| 137 | 137 | { |
| 138 | - if (!array_key_exists($abstract, $this->bindings)) { |
|
| 138 | + if ( ! array_key_exists($abstract, $this->bindings)) { |
|
| 139 | 139 | throw new InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $abstract)); |
| 140 | 140 | } |
| 141 | 141 | |
@@ -154,17 +154,17 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | public function extend($abstract, Closure $callable) |
| 156 | 156 | { |
| 157 | - if (!array_key_exists($abstract, $this->bindings)) { |
|
| 157 | + if ( ! array_key_exists($abstract, $this->bindings)) { |
|
| 158 | 158 | throw new InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $abstract)); |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | $factory = $this->bindings[$abstract]; |
| 162 | 162 | |
| 163 | - if (!($factory instanceof Closure)) { |
|
| 163 | + if ( ! ($factory instanceof Closure)) { |
|
| 164 | 164 | throw new InvalidArgumentException(sprintf('Identifier "%s" does not contain an object definition.', $abstract)); |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - return $this->bindings[$abstract] = function ($c) use ($callable, $factory) { |
|
| 167 | + return $this->bindings[$abstract] = function($c) use ($callable, $factory) { |
|
| 168 | 168 | return $callable($factory($c), $c); |
| 169 | 169 | }; |
| 170 | 170 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | * |
| 39 | 39 | * @param mixed $id |
| 40 | 40 | * |
| 41 | - * @return \Magister\Services\Database\Elegant\Model|\Magister\Services\Support\Collection|null |
|
| 41 | + * @return Model |
|
| 42 | 42 | */ |
| 43 | 43 | public function find($id) |
| 44 | 44 | { |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | /** |
| 59 | 59 | * Execute the query as a select statement. |
| 60 | 60 | * |
| 61 | - * @return \Magister\Services\Support\Collection|static[] |
|
| 61 | + * @return \Magister\Services\Support\Collection |
|
| 62 | 62 | */ |
| 63 | 63 | public function get() |
| 64 | 64 | { |
@@ -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 | { |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | /** |
| 114 | 114 | * Get the underlying query builder instance. |
| 115 | 115 | * |
| 116 | - * @return \Magister\Services\Database\Query\Builder|static |
|
| 116 | + * @return QueryBuilder |
|
| 117 | 117 | */ |
| 118 | 118 | public function getQuery() |
| 119 | 119 | { |
@@ -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 | { |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | * |
| 106 | 106 | * @param mixed $id |
| 107 | 107 | * |
| 108 | - * @return \Magister\Services\Support\Collection|static|null |
|
| 108 | + * @return Model |
|
| 109 | 109 | */ |
| 110 | 110 | public static function find($id) |
| 111 | 111 | { |
@@ -563,7 +563,7 @@ discard block |
||
| 563 | 563 | * |
| 564 | 564 | * @throws \RuntimeException |
| 565 | 565 | * |
| 566 | - * @return void |
|
| 566 | + * @return string |
|
| 567 | 567 | */ |
| 568 | 568 | public function getUrl() |
| 569 | 569 | { |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | { |
| 212 | 212 | $instance = (new static())->setConnection($connection); |
| 213 | 213 | |
| 214 | - $items = array_map(function ($item) use ($instance) { |
|
| 214 | + $items = array_map(function($item) use ($instance) { |
|
| 215 | 215 | return $instance->newFromBuilder($item); |
| 216 | 216 | }, $items); |
| 217 | 217 | |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | $value = $this->getAttributeFromArray($key); |
| 332 | 332 | |
| 333 | 333 | if (in_array($key, $this->getDates())) { |
| 334 | - if (!is_null($value)) { |
|
| 334 | + if ( ! is_null($value)) { |
|
| 335 | 335 | return $this->asDateTime($value); |
| 336 | 336 | } |
| 337 | 337 | } |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | { |
| 389 | 389 | $relations = $this->$method(); |
| 390 | 390 | |
| 391 | - if (!$relations instanceof Relation) { |
|
| 391 | + if ( ! $relations instanceof Relation) { |
|
| 392 | 392 | throw new LogicException('Relationship method must return an object of type '.'Magister\Services\Database\Elegant\Relations\Relation'); |
| 393 | 393 | } |
| 394 | 394 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | * @param string $column |
| 73 | 73 | * @param string $key |
| 74 | 74 | * |
| 75 | - * @return array |
|
| 75 | + * @return Collection |
|
| 76 | 76 | */ |
| 77 | 77 | public function lists($column, $key = null) |
| 78 | 78 | { |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | * |
| 201 | 201 | * @throws \BadMethodCallException |
| 202 | 202 | * |
| 203 | - * @return mixed |
|
| 203 | + * @return Builder |
|
| 204 | 204 | */ |
| 205 | 205 | public function __call($method, $parameters) |
| 206 | 206 | { |
@@ -95,7 +95,7 @@ |
||
| 95 | 95 | { |
| 96 | 96 | $select = is_null($key) ? [$column] : [$column, $key]; |
| 97 | 97 | |
| 98 | - return array_map(function ($column) { |
|
| 98 | + return array_map(function($column) { |
|
| 99 | 99 | $dot = strpos($column, '.'); |
| 100 | 100 | |
| 101 | 101 | return $dot === false ? $column : substr($column, $dot + 1); |
@@ -155,7 +155,7 @@ |
||
| 155 | 155 | /** |
| 156 | 156 | * Create a class based listener using the IoC container. |
| 157 | 157 | * |
| 158 | - * @param mixed $listener |
|
| 158 | + * @param string $listener |
|
| 159 | 159 | * |
| 160 | 160 | * @return \Closure |
| 161 | 161 | */ |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | { |
| 80 | 80 | $responses = []; |
| 81 | 81 | |
| 82 | - if (!is_array($payload)) { |
|
| 82 | + if ( ! is_array($payload)) { |
|
| 83 | 83 | $payload = [$payload]; |
| 84 | 84 | } |
| 85 | 85 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | foreach ($this->getListeners($event) as $listener) { |
| 89 | 89 | $response = call_user_func_array($listener, $payload); |
| 90 | 90 | |
| 91 | - if (!is_null($response) && $halt) { |
|
| 91 | + if ( ! is_null($response) && $halt) { |
|
| 92 | 92 | return $response; |
| 93 | 93 | } |
| 94 | 94 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | public function getListeners($eventName) |
| 113 | 113 | { |
| 114 | - if (!isset($this->sorted[$eventName])) { |
|
| 114 | + if ( ! isset($this->sorted[$eventName])) { |
|
| 115 | 115 | $this->sortListeners($eventName); |
| 116 | 116 | } |
| 117 | 117 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | { |
| 164 | 164 | $container = $this->container; |
| 165 | 165 | |
| 166 | - return function () use ($listener, $container) { |
|
| 166 | + return function() use ($listener, $container) { |
|
| 167 | 167 | $segments = explode('@', $listener); |
| 168 | 168 | |
| 169 | 169 | $method = count($segments) == 2 ? $segments[1] : 'handle'; |
@@ -202,7 +202,7 @@ |
||
| 202 | 202 | /** |
| 203 | 203 | * Remove an item from the collection by key. |
| 204 | 204 | * |
| 205 | - * @param mixed $key |
|
| 205 | + * @param string $key |
|
| 206 | 206 | * |
| 207 | 207 | * @return void |
| 208 | 208 | */ |
@@ -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 | } |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | * Determine if a given string starts with a given substring. |
| 242 | 242 | * |
| 243 | 243 | * @param string $haystack |
| 244 | - * @param string|array $needles |
|
| 244 | + * @param string $needles |
|
| 245 | 245 | * |
| 246 | 246 | * @return bool |
| 247 | 247 | */ |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | /** |
| 297 | 297 | * Get the class "basename" of the given object / class. |
| 298 | 298 | * |
| 299 | - * @param string|object $class |
|
| 299 | + * @param Magister\Services\Database\Elegant\Model $class |
|
| 300 | 300 | * |
| 301 | 301 | * @return string |
| 302 | 302 | */ |
@@ -394,8 +394,9 @@ discard block |
||
| 394 | 394 | /** |
| 395 | 395 | * Return the translation for the foreign. |
| 396 | 396 | * |
| 397 | - * @param string $key |
|
| 398 | 397 | * |
| 398 | + * @param string $foreign |
|
| 399 | + * @param string $model |
|
| 399 | 400 | * @return string |
| 400 | 401 | */ |
| 401 | 402 | function transMagisterModel($foreign, $model) |
@@ -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 | |