From ce268c0040f1bdaf458b76dc9d32da372f82c740 Mon Sep 17 00:00:00 2001 From: Salah Alkhwlani Date: Wed, 4 Oct 2017 14:20:05 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/ServiceProvider.php | 12 ++++-------- tests/TestCase.php | 4 ++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index 10df100..803edc8 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -16,7 +16,7 @@ class ServiceProvider extends BaseServiceProvider */ protected $middleware = [ 'arabic-to-eastern' => TransformArabicToEasternNumbers::class, - 'eastern-to-arabic' => TransformEasternToArabicNumbers::class + 'eastern-to-arabic' => TransformEasternToArabicNumbers::class, ]; /** @@ -37,7 +37,6 @@ class ServiceProvider extends BaseServiceProvider */ protected $auto_middleware; - /** * Perform post-registration booting of services. * @@ -52,7 +51,6 @@ public function boot() $this->autoAppendMiddleware(); } - /** * auto append middleware to router. */ @@ -67,11 +65,9 @@ protected function autoAppendMiddleware() if ($this->groupMiddleware === true) { // Register middleware as global Middleware $this->app->make('Illuminate\Contracts\Http\Kernel')->pushMiddleware($this->auto_middleware); - } else if (is_array($this->groupMiddleware) && count($this->groupMiddleware) > 0) { // Register Middleware for route group + } elseif (is_array($this->groupMiddleware) && count($this->groupMiddleware) > 0) { // Register Middleware for route group $this->pushMiddlewareToGroups($this->auto_middleware); } - - return; } /** @@ -79,7 +75,7 @@ protected function autoAppendMiddleware() * * @param $middleware */ - function pushMiddlewareToGroups($middleware) + public function pushMiddlewareToGroups($middleware) { foreach ($this->groupMiddleware as $group) { $this->app['router']->pushMiddlewareToGroup($group, $middleware); @@ -106,4 +102,4 @@ protected function registerAliasMiddleware() $this->app['router']->aliasMiddleware($alias, $middleware); } } -} \ No newline at end of file +} diff --git a/tests/TestCase.php b/tests/TestCase.php index e17f885..408fb85 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -2,10 +2,10 @@ namespace Yemenifree\LaravelArabicNumbersMiddleware\Test; -use Illuminate\Foundation\Application; use Illuminate\Http\Request; -use Illuminate\Routing\RouteCollection; use Illuminate\Routing\Router; +use Illuminate\Foundation\Application; +use Illuminate\Routing\RouteCollection; use Orchestra\Testbench\TestCase as Orchestra; use Yemenifree\LaravelArabicNumbersMiddleware\ServiceProvider;