Completed
Push — master ( 46671d...c7ced1 )
by
unknown
02:52
created
src/Http/Controllers/RequestController.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
     }
33 33
 
34 34
     /**
35
-     * @return mixed
35
+     * @return \Symfony\Component\HttpFoundation\Response
36 36
      */
37 37
     public function index()
38 38
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
     {
68 68
         $id = $request->id;
69 69
 
70
-        if (! $this->repository->exists($id)) {
70
+        if (!$this->repository->exists($id)) {
71 71
             return response(null, 404);
72 72
         }
73 73
 
Please login to merge, or discard this patch.
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,12 +2,12 @@
 block discarded – undo
2 2
 
3 3
 namespace Loadsman\LaravelPlugin\Http\Controllers;
4 4
 
5
+use Illuminate\Http\Request;
6
+use Illuminate\Routing\Controller;
5 7
 use Loadsman\LaravelPlugin\Contracts\RequestRepositoryInterface;
6 8
 use Loadsman\LaravelPlugin\Entities\RequestEntity;
7 9
 use Loadsman\LaravelPlugin\Http\Requests\StoreRequest;
8 10
 use Loadsman\LaravelPlugin\Http\Requests\UpdateRequest;
9
-use Illuminate\Http\Request;
10
-use Illuminate\Routing\Controller;
11 11
 
12 12
 /**
13 13
  * Class RequestController
Please login to merge, or discard this patch.
src/LoadsmanServiceProvider.php 2 patches
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -7,9 +7,6 @@
 block discarded – undo
7 7
 use Loadsman\LaravelPlugin\Modules\Rule\RuleRepository;
8 8
 use Loadsman\LaravelPlugin\Modules\Rule\RuleServiceProvider;
9 9
 use Loadsman\LaravelPlugin\Providers\MacroServiceProvider;
10
-use Loadsman\LaravelPlugin\Providers\RepositoryServiceProvider;
11
-use Loadsman\LaravelPlugin\Providers\RouteServiceProvider;
12
-use Illuminate\Routing\Router;
13 10
 
14 11
 class LoadsmanServiceProvider extends \Illuminate\Support\ServiceProvider
15 12
 {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     {
18 18
         $this->mergeConfigFrom($this->getConfigPath(), 'loadsman');
19 19
 
20
-        if (! $this->app['config']['loadsman.enabled']) {
20
+        if (!$this->app['config']['loadsman.enabled']) {
21 21
             return;
22 22
         }
23 23
 
@@ -25,10 +25,10 @@  discard block
 block discarded – undo
25 25
         $this->app->register(FrameworkServiceProvider::class);
26 26
         $this->app->register(RuleServiceProvider::class);
27 27
 
28
-        $this->app->bind(RuleRepository::class, function (Container $app) {
28
+        $this->app->bind(RuleRepository::class, function(Container $app) {
29 29
 
30 30
             $routers = [];
31
-            foreach ($app['config']['loadsman.routers'] as $routerName){
31
+            foreach ($app['config']['loadsman.routers'] as $routerName) {
32 32
                 $routers[] = $app->make($routerName);
33 33
             }
34 34
 
Please login to merge, or discard this patch.
src/Http/Middleware/DetectRoute.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
             // Laravel 5.2 event
40 40
             $this->events->listen(RouteMatched::class,
41
-                function (RouteMatched $event) {
41
+                function(RouteMatched $event) {
42 42
                     $this->handleMatchedRoute($event->route);
43 43
                 });
44 44
         }
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         return $next($request);
47 47
     }
48 48
 
49
-    public function handleMatchedRoute($route){
49
+    public function handleMatchedRoute($route) {
50 50
         $routeInfo = new RouteInfo($route);
51 51
 
52 52
         response()->json([
Please login to merge, or discard this patch.
src/Http/Requests/UpdateRequest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
         ];
19 19
     }
20 20
 
21
-    public function authorize(){
21
+    public function authorize() {
22 22
         return true;
23 23
     }
24 24
 }
Please login to merge, or discard this patch.
src/Providers/RouteServiceProvider.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
             'prefix' => config('api-tester.route'),
31 31
             'namespace' => $this->getNamespace(),
32 32
             'middleware' => $this->getMiddleware(),
33
-        ], function () {
33
+        ], function() {
34 34
             $this->requireRoutes();
35 35
         });
36 36
     }
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      */
74 74
     protected function requireRoutes()
75 75
     {
76
-        require __DIR__ . '/../Http/routes.php';
76
+        require __DIR__.'/../Http/routes.php';
77 77
     }
78 78
 
79 79
     /**
Please login to merge, or discard this patch.
Unused Use Statements   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,12 +2,11 @@
 block discarded – undo
2 2
 
3 3
 namespace Loadsman\LaravelPlugin\Providers;
4 4
 
5
-use Loadsman\LaravelPlugin\Http\Middleware\DebugState;
6
-use Loadsman\LaravelPlugin\Http\Middleware\DetectRoute;
7
-use Loadsman\LaravelPlugin\Http\Middleware\PreventRedirect;
8 5
 use Illuminate\Contracts\Http\Kernel;
9 6
 use Illuminate\Routing\Router;
10 7
 use Illuminate\Support\ServiceProvider;
8
+use Loadsman\LaravelPlugin\Http\Middleware\DetectRoute;
9
+use Loadsman\LaravelPlugin\Http\Middleware\PreventRedirect;
11 10
 
12 11
 class RouteServiceProvider extends ServiceProvider
13 12
 {
Please login to merge, or discard this patch.
src/Providers/RepositoryServiceProvider.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
      */
29 29
     public function register()
30 30
     {
31
-        $this->app->singleton(RouteRepositoryInterface::class, function (Container $app) {
31
+        $this->app->singleton(RouteRepositoryInterface::class, function(Container $app) {
32 32
             $repositories = [];
33 33
             foreach (config('api-tester.route_repositories') as $repository) {
34 34
                 $repositories[] = $app->make($repository);
Please login to merge, or discard this patch.
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@
 block discarded – undo
3 3
 namespace Loadsman\LaravelPlugin\Providers;
4 4
 
5 5
 
6
+use Illuminate\Contracts\Container\Container;
7
+use Illuminate\Support\ServiceProvider;
6 8
 use Loadsman\LaravelPlugin\Collections\RouteCollection;
7 9
 use Loadsman\LaravelPlugin\Contracts\RequestRepositoryInterface;
8 10
 use Loadsman\LaravelPlugin\Contracts\RouteRepositoryInterface;
9 11
 use Loadsman\LaravelPlugin\Repositories\RouteRepository;
10
-use Illuminate\Contracts\Container\Container;
11
-use Illuminate\Support\ServiceProvider;
12 12
 
13 13
 class RepositoryServiceProvider extends ServiceProvider
14 14
 {
Please login to merge, or discard this patch.
src/Providers/MacroServiceProvider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
          * Present controller method as `post` route.
16 16
          */
17 17
         app('router')->macro('expose',
18
-            function ($controller = '', Array $actions) {
18
+            function($controller = '', Array $actions) {
19 19
                 foreach ($actions as $action) {
20 20
                     $this->post(snake_case($action, '-'),
21 21
                         $controller.'@'.$action);
@@ -26,13 +26,13 @@  discard block
 block discarded – undo
26 26
          * Expose all public methods of controller.
27 27
          * @see `expose` macro /\
28 28
          */
29
-        app('router')->macro('exposeAll', function ($controllerClassName) {
29
+        app('router')->macro('exposeAll', function($controllerClassName) {
30 30
             $controllerClassReflection = new \ReflectionClass($controllerClassName);
31 31
             $publicActions = $controllerClassReflection->getMethods(\ReflectionMethod::IS_PUBLIC);
32 32
             foreach ($publicActions as $publicAction) {
33 33
                 $declaringClass = $publicAction->getDeclaringClass()->getName();
34 34
                 $isOwn = $declaringClass === $controllerClassName;
35
-                if (! $isOwn) {
35
+                if (!$isOwn) {
36 36
                     continue;
37 37
                 }
38 38
                 $action = $publicAction->getName();
Please login to merge, or discard this patch.
src/Collections/RouteCollection.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
             }
30 30
         }
31 31
 
32
-        return $this->filter(function ($route) use ($patterns) {
32
+        return $this->filter(function($route) use ($patterns) {
33 33
             // If any of patterns matches - route passes.
34 34
             foreach ($patterns as $pattern) {
35 35
                 if ($this->isRouteMatchesPattern($route, $pattern)) {
@@ -69,17 +69,17 @@  discard block
 block discarded – undo
69 69
     private function isRouteMatchesPattern(array $route, array $pattern)
70 70
     {
71 71
         foreach ($route as $key => $value) {
72
-            if (! array_key_exists($key, $pattern)) {
72
+            if (!array_key_exists($key, $pattern)) {
73 73
                 continue;
74 74
             }
75 75
 
76
-            if(is_array($value)){
76
+            if (is_array($value)) {
77 77
                 $value = implode(',', $value);
78 78
             }
79 79
 
80 80
             $regex = '#'.$pattern[$key].'#';
81 81
 
82
-            return ! ! preg_match($regex, $value);
82
+            return !!preg_match($regex, $value);
83 83
         }
84 84
 
85 85
         return true;
Please login to merge, or discard this patch.
src/Modules/Routers/Laravel/LaravelRouter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
     {
22 22
         $routes = $this->router->getRoutes()->getRoutes();
23 23
 
24
-        return array_map(function (Route $route) {
24
+        return array_map(function(Route $route) {
25 25
             return $this->transformer->cast($route);
26 26
         }, $routes);
27 27
     }
Please login to merge, or discard this patch.