Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
],
Expand All @@ -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,
],
],
],
Expand Down
14 changes: 7 additions & 7 deletions src/Commands/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
}

Expand Down
9 changes: 4 additions & 5 deletions src/Commands/PreCommitHookCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -51,7 +50,7 @@ public function handle(): int

render(
view('laranail/git-commit-checker::summary', [
'result' => $result,
'result' => $result,
'isSuccessful' => $process->isSuccessful(),
]),
);
Expand Down
8 changes: 4 additions & 4 deletions src/Providers/GitCommitCheckerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/NamingConventionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down