diff --git a/config/config.php b/config/config.php index 48e499f..655e7c9 100644 --- a/config/config.php +++ b/config/config.php @@ -13,18 +13,18 @@ 'pint' => [ 'presets' => [ - 'laravel' => 'Laravel (Default)', - 'symfony' => 'Symfony', - 'psr12' => 'PSR-12', + 'laravel' => 'Laravel (Default)', + 'symfony' => 'Symfony', + 'psr12' => 'PSR-12', 'recommended' => 'Recommended (PSR-12 Extended)', ], 'recommended_preset' => [ 'preset' => 'psr12', - 'rules' => [ - 'array_syntax' => ['syntax' => 'short'], + 'rules' => [ + 'array_syntax' => ['syntax' => 'short'], 'binary_operator_spaces' => [ - 'default' => 'single_space', + 'default' => 'single_space', 'operators' => [ '=' => null, ], @@ -35,18 +35,18 @@ 'concat_space' => [ 'spacing' => 'one', ], - 'function_typehint_space' => true, - 'native_function_casing' => true, - 'no_extra_blank_lines' => true, - 'no_leading_namespace_whitespace' => true, - 'no_spaces_around_offset' => true, - 'no_unused_imports' => true, - 'not_operator_with_successor_space' => true, + 'function_typehint_space' => true, + 'native_function_casing' => true, + 'no_extra_blank_lines' => true, + 'no_leading_namespace_whitespace' => true, + 'no_spaces_around_offset' => true, + 'no_unused_imports' => true, + 'not_operator_with_successor_space' => true, 'object_operator_without_whitespace' => true, - 'single_quote' => true, - 'trailing_comma_in_multiline' => true, - 'unary_operator_spaces' => true, - 'whitespace_after_comma_in_array' => true, + 'single_quote' => true, + 'trailing_comma_in_multiline' => true, + 'unary_operator_spaces' => true, + 'whitespace_after_comma_in_array' => true, ], ], ], diff --git a/src/Commands/InstallCommand.php b/src/Commands/InstallCommand.php index 2e22754..7c1ac85 100644 --- a/src/Commands/InstallCommand.php +++ b/src/Commands/InstallCommand.php @@ -4,11 +4,11 @@ namespace Simtabi\Laranail\GitCommitChecker\Commands; -use Illuminate\Console\Command; use Illuminate\Console\Application; +use Illuminate\Console\Command; use Illuminate\Console\ConfirmableTrait; -use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Attribute\AsCommand; +use Symfony\Component\Console\Input\InputOption; #[AsCommand('git-commit-checker:install', 'Install "pre_commit" hook into your git.')] class InstallCommand extends Command @@ -62,18 +62,18 @@ protected function install(string $hook, string $class): bool $command = new $class; if ($command instanceof Command === false) { - $this->components->error("Class [$class] is not instance of " . Command::class . '.'); + $this->components->error("Class [$class] is not instance of ".Command::class.'.'); abort(1); } $script = $this->generateHookScript($command->getName()); - $path = $this->laravel->basePath('.git/hooks/' . $hook); + $path = $this->laravel->basePath('.git/hooks/'.$hook); $relativePath = ltrim(str_replace($this->laravel->basePath(), '', $path), DIRECTORY_SEPARATOR); if ( $this->laravel['files']->exists($path) && - ! $this->confirmToProceed($relativePath . ' already exists, do you want to overwrite it?', true) + ! $this->confirmToProceed($relativePath.' already exists, do you want to overwrite it?', true) ) { return false; } @@ -106,9 +106,9 @@ protected function generatePintConfiguration(string $path): void ? ['preset' => $preset] : $this->laravel['config']->get('git-commit-checker.pint.recommended_preset'), JSON_PRETTY_PRINT, - ) . PHP_EOL, + ).PHP_EOL, )) { - $this->components->error('Unable to write ' . $path); + $this->components->error('Unable to write '.$path); abort(1); } diff --git a/src/Commands/PreCommitHookCommand.php b/src/Commands/PreCommitHookCommand.php index 9ad23cc..1aa392e 100644 --- a/src/Commands/PreCommitHookCommand.php +++ b/src/Commands/PreCommitHookCommand.php @@ -4,14 +4,13 @@ namespace Simtabi\Laranail\GitCommitChecker\Commands; +use Illuminate\Console\Command; use Illuminate\Support\Str; +use Symfony\Component\Console\Attribute\AsCommand; +use Symfony\Component\Process\Process; use function Termwind\render; -use Illuminate\Console\Command; -use Symfony\Component\Process\Process; -use Symfony\Component\Console\Attribute\AsCommand; - #[AsCommand('git-commit-checker:pre-commit-hook', 'Git hook before commit')] class PreCommitHookCommand extends Command { @@ -51,7 +50,7 @@ public function handle(): int render( view('laranail/git-commit-checker::summary', [ - 'result' => $result, + 'result' => $result, 'isSuccessful' => $process->isSuccessful(), ]), ); diff --git a/src/Providers/GitCommitCheckerServiceProvider.php b/src/Providers/GitCommitCheckerServiceProvider.php index 7b5b27c..c9187e6 100644 --- a/src/Providers/GitCommitCheckerServiceProvider.php +++ b/src/Providers/GitCommitCheckerServiceProvider.php @@ -10,22 +10,22 @@ class GitCommitCheckerServiceProvider extends ServiceProvider { public function register(): void { - $this->mergeConfigFrom(__DIR__ . '/../../config/config.php', 'laranail.git-commit-checker'); + $this->mergeConfigFrom(__DIR__.'/../../config/config.php', 'laranail.git-commit-checker'); } public function boot() { $this->app->register(CommandServiceProvider::class); - $this->loadViewsFrom(__DIR__ . '/../../resources/views', 'laranail/git-commit-checker'); + $this->loadViewsFrom(__DIR__.'/../../resources/views', 'laranail/git-commit-checker'); if ($this->app->runningInConsole()) { $this->publishes([ - __DIR__ . '/../../config/config.php' => config_path('git-commit-checker.php'), + __DIR__.'/../../config/config.php' => config_path('git-commit-checker.php'), ], 'laranail::git-commit-checker-config'); $this->publishes([ - __DIR__ . '/../../resources/views' => resource_path('views/vendor/laranail/git-commit-checker'), + __DIR__.'/../../resources/views' => resource_path('views/vendor/laranail/git-commit-checker'), ], 'laranail::git-commit-checker-views'); } } diff --git a/tests/Feature/NamingConventionTest.php b/tests/Feature/NamingConventionTest.php index c97aa2f..f5cdbad 100644 --- a/tests/Feature/NamingConventionTest.php +++ b/tests/Feature/NamingConventionTest.php @@ -2,8 +2,8 @@ declare(strict_types=1); -use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\Config; +use Illuminate\Support\Facades\View; /** * Every name this package registers into a framework-owned registry.