Skip to content

Commit 8d5d60e

Browse files
Refactor code
1 parent f1fbfd4 commit 8d5d60e

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/Commands/InstallPhpCs.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Illuminate\Console\Command;
66
use Illuminate\Console\ConfirmableTrait;
77

8-
class InstallPhpcs extends Command
8+
class InstallPhpCs extends Command
99
{
1010
use ConfirmableTrait;
1111

@@ -30,27 +30,27 @@ class InstallPhpcs extends Command
3030
*/
3131
public function handle()
3232
{
33-
$phpcs = __DIR__ . '/../../phpcs.xml';
34-
$rootphpcs = base_path('phpcs.xml');
33+
$phpCs = __DIR__ . '/../../phpcs.xml';
34+
$rootPhpCs = base_path('phpcs.xml');
3535

3636
// Checkout existence of sample phpcs.xml.
37-
if (!file_exists($phpcs)) {
37+
if (!file_exists($phpCs)) {
3838
$this->error('The sample phpcs.xml does not exist! Try to reinstall botble/git-commit-checker package!');
3939

4040
return 1;
4141
}
4242

4343
// Checkout existence phpcs.xml in root path of project.
44-
if (file_exists($rootphpcs)) {
44+
if (file_exists($rootPhpCs)) {
4545
if (!$this->confirmToProceed('phpcs.xml already exists, do you want to overwrite it?', true)) {
4646
return 1;
4747
}
4848

4949
// Remove old phpcs.xml file form root
50-
unlink($rootphpcs);
50+
unlink($rootPhpCs);
5151
}
5252

53-
$this->writePHPCS($phpcs, $rootphpcs)
53+
$this->writePHPCS($phpCs, $rootPhpCs)
5454
? $this->info('Phpcs.xml successfully created!')
5555
: $this->error('Unable to create phpcs.xml');
5656

@@ -64,10 +64,10 @@ public function handle()
6464
* @param string $rootphpcs
6565
* @return bool
6666
*/
67-
protected function writePHPCS(string $phpcs, string $rootphpcs): bool
67+
protected function writePHPCS(string $phpCs, string $rootPhpCs): bool
6868
{
6969
// phpcs.xml file to root
70-
if (!copy($phpcs, $rootphpcs)) {
70+
if (!copy($phpCs, $rootPhpCs)) {
7171
return false;
7272
}
7373

src/Providers/CommandServiceProvider.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Botble\GitCommitChecker\Providers;
44

55
use Botble\GitCommitChecker\Commands\InstallHooks;
6-
use Botble\GitCommitChecker\Commands\InstallPhpcs;
6+
use Botble\GitCommitChecker\Commands\InstallPhpCs;
77
use Botble\GitCommitChecker\Commands\PreCommitHook;
88
use Illuminate\Support\ServiceProvider;
99

@@ -15,7 +15,7 @@ public function boot()
1515
$this->commands([
1616
InstallHooks::class,
1717
PreCommitHook::class,
18-
InstallPhpcs::class,
18+
InstallPhpCs::class,
1919
]);
2020
}
2121
}

0 commit comments

Comments
 (0)