From 5eb0fb02d6fcb21610831a425924f3151a77429e Mon Sep 17 00:00:00 2001 From: Mitul Golakiya Date: Tue, 22 Feb 2022 11:42:44 +0530 Subject: [PATCH] style: Apply fixes from StyleCI (#995) Co-authored-by: StyleCI Bot --- src/Commands/Publish/GeneratorPublishCommand.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Commands/Publish/GeneratorPublishCommand.php b/src/Commands/Publish/GeneratorPublishCommand.php index 46d052d2a..28e526665 100755 --- a/src/Commands/Publish/GeneratorPublishCommand.php +++ b/src/Commands/Publish/GeneratorPublishCommand.php @@ -2,7 +2,6 @@ namespace InfyOm\Generator\Commands\Publish; -use Illuminate\Support\Str; use InfyOm\Generator\Utils\FileUtil; use Symfony\Component\Console\Input\InputOption; @@ -64,20 +63,21 @@ private function fillTemplate($templateData) private function updateRouteServiceProvider() { - $routeServiceProviderPath = app_path('Providers'.DIRECTORY_SEPARATOR."RouteServiceProvider.php"); + $routeServiceProviderPath = app_path('Providers'.DIRECTORY_SEPARATOR.'RouteServiceProvider.php'); if (!file_exists($routeServiceProviderPath)) { $this->error("Route Service provider not found on $routeServiceProviderPath"); + return 1; } $fileContent = file_get_contents($routeServiceProviderPath); - $search = "Route::prefix('api')".PHP_EOL.str(" ")->repeat(16)."->middleware('api')"; + $search = "Route::prefix('api')".PHP_EOL.str(' ')->repeat(16)."->middleware('api')"; $beforeContent = str($fileContent)->before($search); $afterContent = str($fileContent)->after($search); - $finalContent = $beforeContent.$search.PHP_EOL.str(" ")->repeat(16)."->as('api.')".$afterContent; + $finalContent = $beforeContent.$search.PHP_EOL.str(' ')->repeat(16)."->as('api.')".$afterContent; file_put_contents($routeServiceProviderPath, $finalContent); return 0;