Completed
Push — master ( acbbc3...48e3a6 )
by Adrian
05:57
created
src/Http/Controllers/ModelController.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -25,6 +25,9 @@
 block discarded – undo
25 25
         $this->formGenerator = $formGenerator;
26 26
     }
27 27
     
28
+    /**
29
+     * @param string $methodName
30
+     */
28 31
     private function authorizeMethod(Model $modelAbstractor, $methodName)
29 32
     {
30 33
         if (array_key_exists('authorize', $config = $modelAbstractor->getConfig()) && $config['authorize'] === true) {
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
      */
39 39
     private function customController(Model $modelAbstractor)
40 40
     {
41
-        if (! $this instanceof CustomController) { //Avoid infinite recursion
42
-            if (array_key_exists('controller', $config = $modelAbstractor->getConfig()) && (! empty($config['controller']))) {
41
+        if (!$this instanceof CustomController) { //Avoid infinite recursion
42
+            if (array_key_exists('controller', $config = $modelAbstractor->getConfig()) && (!empty($config['controller']))) {
43 43
                 /** @var CustomController $controller */
44 44
                 $controller = App::make($config['controller']);
45 45
                 $controller->setAbstractor($modelAbstractor);
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
         $this->authorizeMethod($modelAbstractor, 'adminIndex');
64 64
 
65
-        if (! empty($customController = $this->customController($modelAbstractor))) {
65
+        if (!empty($customController = $this->customController($modelAbstractor))) {
66 66
             return $customController->index($request, $model);
67 67
         }
68 68
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
         $this->authorizeMethod($modelAbstractor, 'adminCreate');
104 104
 
105
-        if (! empty($customController = $this->customController($modelAbstractor))) {
105
+        if (!empty($customController = $this->customController($modelAbstractor))) {
106 106
             return $customController->create($model);
107 107
         }
108 108
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 
129 129
         $this->authorizeMethod($modelAbstractor, 'adminStore');
130 130
 
131
-        if (! empty($customController = $this->customController($modelAbstractor))) {
131
+        if (!empty($customController = $this->customController($modelAbstractor))) {
132 132
             return $customController->store($request, $model);
133 133
         }
134 134
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 
163 163
         $this->authorizeMethod($modelAbstractor, 'adminShow');
164 164
 
165
-        if (! empty($customController = $this->customController($modelAbstractor))) {
165
+        if (!empty($customController = $this->customController($modelAbstractor))) {
166 166
             return $customController->show($model, $id);
167 167
         }
168 168
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 
190 190
         $this->authorizeMethod($modelAbstractor, 'adminEdit');
191 191
 
192
-        if (! empty($customController = $this->customController($modelAbstractor))) {
192
+        if (!empty($customController = $this->customController($modelAbstractor))) {
193 193
             return $customController->edit($model, $id);
194 194
         }
195 195
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 
220 220
         $this->authorizeMethod($modelAbstractor, 'adminUpdate');
221 221
 
222
-        if (! empty($customController = $this->customController($modelAbstractor))) {
222
+        if (!empty($customController = $this->customController($modelAbstractor))) {
223 223
             return $customController->update($request, $model, $id);
224 224
         }
225 225
 
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 
255 255
         $this->authorizeMethod($modelAbstractor, 'adminDestroy');
256 256
 
257
-        if (! empty($customController = $this->customController($modelAbstractor))) {
257
+        if (!empty($customController = $this->customController($modelAbstractor))) {
258 258
             return $customController->destroy($request, $model, $id);
259 259
         }
260 260
 
Please login to merge, or discard this patch.
src/Http/Controllers/HomeController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
             $modelAbstractor = $modelFactory->getByName($modelSlug);
24 24
             $config = $modelAbstractor->getConfig();
25 25
 
26
-            if (! array_key_exists('authorize', $config) || ( $config['authorize'] === true && Gate::allows('adminIndex', $modelAbstractor->getInstance()))) {
26
+            if (!array_key_exists('authorize', $config) || ($config['authorize'] === true && Gate::allows('adminIndex', $modelAbstractor->getInstance()))) {
27 27
                 return new RedirectResponse(route('anavel-crud.model.index', $modelSlug));
28 28
             }
29 29
 
Please login to merge, or discard this patch.
src/Repository/Criteria/SearchCriteria.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,11 +41,11 @@
 block discarded – undo
41 41
         $columnRelation = explode('.', $column);
42 42
 
43 43
         if ($or) {
44
-            $query->orWhereHas($columnRelation[0], function ($subquery) use ($columnRelation) {
44
+            $query->orWhereHas($columnRelation[0], function($subquery) use ($columnRelation) {
45 45
                 $subquery->where($columnRelation[1], 'LIKE', '%'.$this->queryString.'%');
46 46
             });
47 47
         } else {
48
-            $query->whereHas($columnRelation[0], function ($subquery) use ($columnRelation) {
48
+            $query->whereHas($columnRelation[0], function($subquery) use ($columnRelation) {
49 49
                 $subquery->where($columnRelation[1], 'LIKE', '%'.$this->queryString.'%');
50 50
             });
51 51
         }
Please login to merge, or discard this patch.