@@ -27,7 +27,7 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | public function cant($ability, $arguments = []) |
| 29 | 29 | { |
| 30 | - return ! $this->can($ability, $arguments); |
|
| 30 | + return !$this->can($ability, $arguments); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | /** |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | protected function registerRepository() |
| 70 | 70 | { |
| 71 | 71 | // l5-repository validator |
| 72 | - $this->app->bind('Symfony\Component\Translation\TranslatorInterface', function ($app) { |
|
| 72 | + $this->app->bind('Symfony\Component\Translation\TranslatorInterface', function($app) { |
|
| 73 | 73 | return $app['translator']; |
| 74 | 74 | }); |
| 75 | 75 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function present($data) |
| 26 | 26 | { |
| 27 | - if (! class_exists('League\Fractal\Manager')) { |
|
| 27 | + if (!class_exists('League\Fractal\Manager')) { |
|
| 28 | 28 | throw new Exception(trans('repository::packages.league_fractal_required')); |
| 29 | 29 | } |
| 30 | 30 | if ($data instanceof Collection) { |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | $orderBy = $this->request->get(config('repository.criteria.params.orderBy', 'orderBy'), null); |
| 44 | 44 | $sortedBy = $this->request->get(config('repository.criteria.params.sortedBy', 'sortedBy'), 'asc'); |
| 45 | 45 | $with = $this->request->get(config('repository.criteria.params.with', 'with'), null); |
| 46 | - $sortedBy = ! empty($sortedBy) ? $sortedBy : 'asc'; |
|
| 46 | + $sortedBy = !empty($sortedBy) ? $sortedBy : 'asc'; |
|
| 47 | 47 | |
| 48 | 48 | if ($search && is_array($fieldsSearchable) && count($fieldsSearchable)) { |
| 49 | 49 | $searchFields = is_array($searchFields) || is_null($searchFields) ? $searchFields : explode(';', |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $search = $this->parserSearchValue($search); |
| 55 | 55 | $modelForceAndWhere = false; |
| 56 | 56 | |
| 57 | - $model = $model->where(function ($query) use ( |
|
| 57 | + $model = $model->where(function($query) use ( |
|
| 58 | 58 | $fields, |
| 59 | 59 | $search, |
| 60 | 60 | $searchData, |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | if (isset($searchData[$field])) { |
| 77 | 77 | $value = ($condition == 'like' || $condition == 'ilike') ? "%{$searchData[$field]}%" : $searchData[$field]; |
| 78 | 78 | } else { |
| 79 | - if (! is_null($search)) { |
|
| 79 | + if (!is_null($search)) { |
|
| 80 | 80 | $value = ($condition == 'like' || $condition == 'ilike') ? "%{$search}%" : $search; |
| 81 | 81 | } |
| 82 | 82 | } |
@@ -89,9 +89,9 @@ discard block |
||
| 89 | 89 | } |
| 90 | 90 | $modelTableName = $query->getModel()->getTable(); |
| 91 | 91 | if ($isFirstField || $modelForceAndWhere) { |
| 92 | - if (! is_null($value)) { |
|
| 93 | - if (! is_null($relation)) { |
|
| 94 | - $query->whereHas($relation, function ($query) use ($field, $condition, $value) { |
|
| 92 | + if (!is_null($value)) { |
|
| 93 | + if (!is_null($relation)) { |
|
| 94 | + $query->whereHas($relation, function($query) use ($field, $condition, $value) { |
|
| 95 | 95 | $query->where($field, $condition, $value); |
| 96 | 96 | }); |
| 97 | 97 | } else { |
@@ -100,9 +100,9 @@ discard block |
||
| 100 | 100 | $isFirstField = false; |
| 101 | 101 | } |
| 102 | 102 | } else { |
| 103 | - if (! is_null($value)) { |
|
| 104 | - if (! is_null($relation)) { |
|
| 105 | - $query->orWhereHas($relation, function ($query) use ($field, $condition, $value) { |
|
| 103 | + if (!is_null($value)) { |
|
| 104 | + if (!is_null($relation)) { |
|
| 105 | + $query->orWhereHas($relation, function($query) use ($field, $condition, $value) { |
|
| 106 | 106 | $query->where($field, $condition, $value); |
| 107 | 107 | }); |
| 108 | 108 | } else { |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | }); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - if (isset($orderBy) && ! empty($orderBy)) { |
|
| 117 | + if (isset($orderBy) && !empty($orderBy)) { |
|
| 118 | 118 | $split = explode('|', $orderBy); |
| 119 | 119 | if (count($split) > 1) { |
| 120 | 120 | /* |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - if (isset($filter) && ! empty($filter)) { |
|
| 154 | + if (isset($filter) && !empty($filter)) { |
|
| 155 | 155 | if (is_string($filter)) { |
| 156 | 156 | $filter = explode(';', $filter); |
| 157 | 157 | } |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | */ |
| 177 | 177 | protected function parserFieldsSearch(array $fields = [], array $searchFields = null) |
| 178 | 178 | { |
| 179 | - if (! is_null($searchFields) && count($searchFields)) { |
|
| 179 | + if (!is_null($searchFields) && count($searchFields)) { |
|
| 180 | 180 | $acceptedConditions = config('repository.criteria.acceptedConditions', [ |
| 181 | 181 | '=', |
| 182 | 182 | 'like', |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | */ |
| 90 | 90 | public function validateWithBag($errorBag, Request $request, array $rules, array $messages = [], array $customAttributes = []) |
| 91 | 91 | { |
| 92 | - $this->withErrorBag($errorBag, function () use ($request, $rules, $messages, $customAttributes) { |
|
| 92 | + $this->withErrorBag($errorBag, function() use ($request, $rules, $messages, $customAttributes) { |
|
| 93 | 93 | $this->validate($request, $rules, $messages, $customAttributes); |
| 94 | 94 | }); |
| 95 | 95 | } |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | /** |
| 36 | 36 | * Execute the command. |
| 37 | 37 | * |
| 38 | - * @return void |
|
| 38 | + * @return null|false |
|
| 39 | 39 | */ |
| 40 | 40 | public function fire() |
| 41 | 41 | { |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | */ |
| 73 | 73 | public function getFillable() |
| 74 | 74 | { |
| 75 | - if (! $this->fillable) { |
|
| 75 | + if (!$this->fillable) { |
|
| 76 | 76 | return '[]'; |
| 77 | 77 | } |
| 78 | 78 | $results = '['.PHP_EOL; |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | */ |
| 73 | 73 | public function getFillable() |
| 74 | 74 | { |
| 75 | - if (! $this->fillable) { |
|
| 75 | + if (!$this->fillable) { |
|
| 76 | 76 | return '[]'; |
| 77 | 77 | } |
| 78 | 78 | $results = '['.PHP_EOL; |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | public function registerViaConnectionMethod() |
| 88 | 88 | { |
| 89 | 89 | foreach ($this->classes as $driver => $class) { |
| 90 | - Connection::resolverFor($driver, function ($connection, $database, $prefix, $config) use ($class) { |
|
| 90 | + Connection::resolverFor($driver, function($connection, $database, $prefix, $config) use ($class) { |
|
| 91 | 91 | return new $class($connection, $database, $prefix, $config); |
| 92 | 92 | }); |
| 93 | 93 | } |