@@ -14,7 +14,7 @@ |
||
14 | 14 | { |
15 | 15 | $router->group([ |
16 | 16 | 'prefix' => 'loadsman/rules', |
17 | - ], function ($router) { |
|
17 | + ], function($router) { |
|
18 | 18 | $router->exposeAll(RuleController::class); |
19 | 19 | }); |
20 | 20 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | $rules = app(RuleRepository::class)->getAll(); |
13 | 13 | |
14 | 14 | $transformer = new RuleTransformer(); |
15 | - $data = array_map(function (Rule $rule) use ($transformer) { |
|
15 | + $data = array_map(function(Rule $rule) use ($transformer) { |
|
16 | 16 | return $transformer->transform($rule); |
17 | 17 | }, $rules); |
18 | 18 |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace Loadsman\LaravelPlugin\Http\Controllers; |
4 | 4 | |
5 | -use Loadsman\LaravelPlugin\Contracts\RouteRepositoryInterface; |
|
6 | 5 | use Illuminate\Routing\Controller; |
6 | +use Loadsman\LaravelPlugin\Contracts\RouteRepositoryInterface; |
|
7 | 7 | |
8 | 8 | /** |
9 | 9 | * Class RoutesController |
@@ -2,10 +2,10 @@ |
||
2 | 2 | |
3 | 3 | namespace Loadsman\LaravelPlugin\Repositories; |
4 | 4 | |
5 | +use Illuminate\Routing\Router; |
|
5 | 6 | use Loadsman\LaravelPlugin\Collections\RouteCollection; |
6 | 7 | use Loadsman\LaravelPlugin\Contracts\RouteRepositoryInterface; |
7 | 8 | use Loadsman\LaravelPlugin\Entities\RouteInfo; |
8 | -use Illuminate\Routing\Router; |
|
9 | 9 | |
10 | 10 | class RouteLaravelRepository implements RouteRepositoryInterface |
11 | 11 | { |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | { |
109 | 109 | $reflection = $this->getActionReflection(); |
110 | 110 | |
111 | - if (! is_null($reflection)) { |
|
111 | + if (!is_null($reflection)) { |
|
112 | 112 | return $reflection->getDocComment(); |
113 | 113 | } |
114 | 114 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | } |
139 | 139 | |
140 | 140 | // We don't care if argument is anything but FormRequest |
141 | - if (! is_subclass_of($class->name, FormRequest::class)) { |
|
141 | + if (!is_subclass_of($class->name, FormRequest::class)) { |
|
142 | 142 | continue; |
143 | 143 | } |
144 | 144 | |
@@ -187,14 +187,14 @@ discard block |
||
187 | 187 | list($controller, $action) = explode('@', $uses); |
188 | 188 | |
189 | 189 | // Controller is missing. |
190 | - if (! class_exists($controller)) { |
|
190 | + if (!class_exists($controller)) { |
|
191 | 191 | $this->setError('uses', 'controller does not exists'); |
192 | 192 | |
193 | 193 | return null; |
194 | 194 | } |
195 | 195 | |
196 | 196 | // Action is missing. |
197 | - if (! method_exists($controller, $action)) { |
|
197 | + if (!method_exists($controller, $action)) { |
|
198 | 198 | $this->setError('uses', 'controller@method does not exists'); |
199 | 199 | |
200 | 200 | return null; |
@@ -237,6 +237,10 @@ |
||
237 | 237 | return $this->route->$methodName(); |
238 | 238 | } |
239 | 239 | |
240 | + /** |
|
241 | + * @param string $type |
|
242 | + * @param string $text |
|
243 | + */ |
|
240 | 244 | protected function setError($type, $text, $params = []) |
241 | 245 | { |
242 | 246 | $this->errors[$type] = trans($text, $params); |