From 4121ab8166d15df04ffb587fba2149ca1a39e086 Mon Sep 17 00:00:00 2001 From: Lupacescu Eduard Date: Mon, 6 Jan 2020 19:03:11 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/LaravelRestifyServiceProvider.php | 8 ++++---- src/Restify.php | 9 +++------ src/RestifyServiceProvider.php | 5 ++--- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/LaravelRestifyServiceProvider.php b/src/LaravelRestifyServiceProvider.php index dcea76d09..527ac19f9 100644 --- a/src/LaravelRestifyServiceProvider.php +++ b/src/LaravelRestifyServiceProvider.php @@ -50,15 +50,15 @@ public function register() protected function registerPublishing() { $this->publishes([ - __DIR__ . '/Commands/stubs/RestifyServiceProvider.stub' => app_path('Providers/RestifyServiceProvider.php'), + __DIR__.'/Commands/stubs/RestifyServiceProvider.stub' => app_path('Providers/RestifyServiceProvider.php'), ], 'restify-provider'); $this->publishes([ - __DIR__ . '/../config/config.php' => config_path('restify.php'), + __DIR__.'/../config/config.php' => config_path('restify.php'), ], 'restify-config'); - if ( ! $this->app->configurationIsCached()) { - $this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'laravel-restify'); + if (! $this->app->configurationIsCached()) { + $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'laravel-restify'); } } } diff --git a/src/Restify.php b/src/Restify.php index 0b8d22469..7dc61c727 100644 --- a/src/Restify.php +++ b/src/Restify.php @@ -6,7 +6,6 @@ use Binaryk\LaravelRestify\Events\RestifyStarting; use Binaryk\LaravelRestify\Repositories\Repository; use Binaryk\LaravelRestify\Traits\AuthorizesRequests; -use Illuminate\Support\Collection; use Illuminate\Support\Facades\Event; use Illuminate\Support\Str; use ReflectionClass; @@ -91,10 +90,10 @@ public static function repositoriesFrom($directory) $repositories = []; foreach ((new Finder)->in($directory)->files() as $repository) { - $repository = $namespace . str_replace( + $repository = $namespace.str_replace( ['/', '.php'], ['\\', ''], - Str::after($repository->getPathname(), app_path() . DIRECTORY_SEPARATOR) + Str::after($repository->getPathname(), app_path().DIRECTORY_SEPARATOR) ); if (is_subclass_of($repository, Repository::class) && (new ReflectionClass($repository))->isInstantiable()) { @@ -116,10 +115,8 @@ public static function repositoriesFrom($directory) public static function path($plus = null) { if (isset($plus)) { - - return config('restify.base', '/restify-api') . '/' . $plus; + return config('restify.base', '/restify-api').'/'.$plus; } else { - return config('restify.base', '/restify-api'); } } diff --git a/src/RestifyServiceProvider.php b/src/RestifyServiceProvider.php index e2461e2d6..0dcc9dcd9 100644 --- a/src/RestifyServiceProvider.php +++ b/src/RestifyServiceProvider.php @@ -36,7 +36,6 @@ protected function registerRoutes() $this->customDefinitions($config) ->defaultRoutes($config); - } /** @@ -53,7 +52,7 @@ public function customDefinitions($config) $config['prefix'] = Restify::path($repository::$prefix); Route::group($config, function () { - $this->loadRoutesFrom(__DIR__ . '/../routes/api.php'); + $this->loadRoutesFrom(__DIR__.'/../routes/api.php'); }); }); @@ -67,7 +66,7 @@ public function customDefinitions($config) public function defaultRoutes($config) { Route::group($config, function () { - $this->loadRoutesFrom(__DIR__ . '/../routes/api.php'); + $this->loadRoutesFrom(__DIR__.'/../routes/api.php'); }); return $this;