Skip to content

Commit

Permalink
style: Apply fixes from StyleCI (#995)
Browse files Browse the repository at this point in the history
Co-authored-by: StyleCI Bot <[email protected]>
  • Loading branch information
mitulgolakiya and StyleCIBot authored Feb 22, 2022
1 parent 2e2e4c5 commit 5eb0fb0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Commands/Publish/GeneratorPublishCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace InfyOm\Generator\Commands\Publish;

use Illuminate\Support\Str;
use InfyOm\Generator\Utils\FileUtil;
use Symfony\Component\Console\Input\InputOption;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 5eb0fb0

Please sign in to comment.