Skip to content

Commit 5c67be9

Browse files
committed
Apply fixes from StyleCI
1 parent ce5189b commit 5c67be9

File tree

5 files changed

+41
-41
lines changed

5 files changed

+41
-41
lines changed

src/AccessServiceProvider.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class AccessServiceProvider extends ServiceProvider
1212
{
1313
protected array $devCommands = [
14-
'ControlMake' => ControlMakeCommand::class,
14+
'ControlMake' => ControlMakeCommand::class,
1515
'PerimeterMake' => PerimeterMakeCommand::class,
1616
];
1717

@@ -45,7 +45,8 @@ public function boot()
4545
/**
4646
* Register the given commands.
4747
*
48-
* @param array $commands
48+
* @param array $commands
49+
*
4950
* @return void
5051
*/
5152
protected function registerCommands(array $commands)
@@ -64,9 +65,10 @@ protected function registerCommands(array $commands)
6465
}
6566

6667
/**
67-
* Register the stubs on the default laravel stub publish command
68+
* Register the stubs on the default laravel stub publish command.
6869
*/
69-
protected function registerStubs() {
70+
protected function registerStubs()
71+
{
7072
Event::listen(function (PublishingStubs $event) {
7173
$event->add(realpath(__DIR__.'/Console/stubs/control.stub'), 'controller.stub');
7274
$event->add(realpath(__DIR__.'/Console/stubs/perimeter.plain.stub'), 'perimeter.plain.stub');

src/Console/ControlMakeCommand.php

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,14 @@
22

33
namespace Lomkit\Access\Console;
44

5-
use Illuminate\Console\Concerns\CreatesMatchingTest;
65
use Illuminate\Console\GeneratorCommand;
76
use Illuminate\Support\Collection;
8-
use Illuminate\Support\Str;
9-
use InvalidArgumentException;
107
use Symfony\Component\Console\Attribute\AsCommand;
118
use Symfony\Component\Console\Input\InputInterface;
129
use Symfony\Component\Console\Input\InputOption;
1310
use Symfony\Component\Console\Output\OutputInterface;
14-
1511
use Symfony\Component\Finder\Finder;
16-
use function Laravel\Prompts\confirm;
17-
use function Laravel\Prompts\select;
12+
1813
use function Laravel\Prompts\multiselect;
1914

2015
#[AsCommand(name: 'make:control')]
@@ -54,7 +49,8 @@ protected function getStub()
5449
/**
5550
* Resolve the fully-qualified path to the stub.
5651
*
57-
* @param string $stub
52+
* @param string $stub
53+
*
5854
* @return string
5955
*/
6056
protected function resolveStubPath($stub)
@@ -67,7 +63,8 @@ protected function resolveStubPath($stub)
6763
/**
6864
* Get the default namespace for the class.
6965
*
70-
* @param string $rootNamespace
66+
* @param string $rootNamespace
67+
*
7168
* @return string
7269
*/
7370
protected function getDefaultNamespace($rootNamespace)
@@ -80,7 +77,8 @@ protected function getDefaultNamespace($rootNamespace)
8077
*
8178
* Remove the base controller import if we are already in the base namespace.
8279
*
83-
* @param string $name
80+
* @param string $name
81+
*
8482
* @return string
8583
*/
8684
protected function buildClass($name)
@@ -102,15 +100,18 @@ protected function buildClass($name)
102100
}
103101

104102
return str_replace(
105-
array_keys($replace), array_values($replace), parent::buildClass($name)
103+
array_keys($replace),
104+
array_values($replace),
105+
parent::buildClass($name)
106106
);
107107
}
108108

109109
/**
110110
* Build the model replacement values.
111111
*
112-
* @param array $replace
113-
* @param array $perimeters
112+
* @param array $replace
113+
* @param array $perimeters
114+
*
114115
* @return array
115116
*/
116117
protected function buildPerimetersReplacements(array $replace, array $perimeters)
@@ -137,7 +138,7 @@ protected function buildPerimetersReplacements(array $replace, array $perimeters
137138

138139
return array_merge($replace, [
139140
'{{ perimeters }}' => $perimetersImplementation,
140-
'{{perimeters}}' => $perimetersImplementation,
141+
'{{perimeters}}' => $perimetersImplementation,
141142
]);
142143
}
143144

@@ -156,8 +157,9 @@ protected function getOptions()
156157
/**
157158
* Interact further with the user if they were prompted for missing arguments.
158159
*
159-
* @param \Symfony\Component\Console\Input\InputInterface $input
160-
* @param \Symfony\Component\Console\Output\OutputInterface $output
160+
* @param \Symfony\Component\Console\Input\InputInterface $input
161+
* @param \Symfony\Component\Console\Output\OutputInterface $output
162+
*
161163
* @return void
162164
*/
163165
protected function afterPromptingForMissingArguments(InputInterface $input, OutputInterface $output)

src/Console/PerimeterMakeCommand.php

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,12 @@
22

33
namespace Lomkit\Access\Console;
44

5-
use Illuminate\Console\Concerns\CreatesMatchingTest;
65
use Illuminate\Console\GeneratorCommand;
7-
use Illuminate\Support\Collection;
8-
use Illuminate\Support\Str;
9-
use InvalidArgumentException;
106
use Symfony\Component\Console\Attribute\AsCommand;
117
use Symfony\Component\Console\Input\InputInterface;
128
use Symfony\Component\Console\Input\InputOption;
139
use Symfony\Component\Console\Output\OutputInterface;
1410

15-
use Symfony\Component\Finder\Finder;
16-
use function Laravel\Prompts\confirm;
17-
use function Laravel\Prompts\select;
18-
use function Laravel\Prompts\multiselect;
19-
2011
#[AsCommand(name: 'make:perimeter')]
2112
class PerimeterMakeCommand extends GeneratorCommand
2213
{
@@ -51,7 +42,7 @@ protected function getStub()
5142
$stub = null;
5243

5344
if ($this->option('overlay')) {
54-
$stub = "/stubs/perimeter.overlay.stub";
45+
$stub = '/stubs/perimeter.overlay.stub';
5546
}
5647

5748
$stub ??= '/stubs/perimeter.plain.stub';
@@ -62,7 +53,8 @@ protected function getStub()
6253
/**
6354
* Resolve the fully-qualified path to the stub.
6455
*
65-
* @param string $stub
56+
* @param string $stub
57+
*
6658
* @return string
6759
*/
6860
protected function resolveStubPath($stub)
@@ -75,7 +67,8 @@ protected function resolveStubPath($stub)
7567
/**
7668
* Get the default namespace for the class.
7769
*
78-
* @param string $rootNamespace
70+
* @param string $rootNamespace
71+
*
7972
* @return string
8073
*/
8174
protected function getDefaultNamespace($rootNamespace)
@@ -88,15 +81,18 @@ protected function getDefaultNamespace($rootNamespace)
8881
*
8982
* Remove the base controller import if we are already in the base namespace.
9083
*
91-
* @param string $name
84+
* @param string $name
85+
*
9286
* @return string
9387
*/
9488
protected function buildClass($name)
9589
{
9690
$replace = [];
9791

9892
return str_replace(
99-
array_keys($replace), array_values($replace), parent::buildClass($name)
93+
array_keys($replace),
94+
array_values($replace),
95+
parent::buildClass($name)
10096
);
10197
}
10298

@@ -115,8 +111,9 @@ protected function getOptions()
115111
/**
116112
* Interact further with the user if they were prompted for missing arguments.
117113
*
118-
* @param \Symfony\Component\Console\Input\InputInterface $input
119-
* @param \Symfony\Component\Console\Output\OutputInterface $output
114+
* @param \Symfony\Component\Console\Input\InputInterface $input
115+
* @param \Symfony\Component\Console\Output\OutputInterface $output
116+
*
120117
* @return void
121118
*/
122119
protected function afterPromptingForMissingArguments(InputInterface $input, OutputInterface $output)

tests/Unit/Console/MakeCommandsTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Lomkit\Access\Tests\Unit\Console;
44

5-
use Illuminate\Support\Facades\Artisan;
65
use Lomkit\Access\Tests\Unit\TestCase;
76

87
class MakeCommandsTest extends TestCase
@@ -95,4 +94,4 @@ public function test_make_control_with_perimeters_command()
9594
unlink(app_path('Access/Perimeters/SecondTestPerimeter.php'));
9695
unlink(app_path('Access/Controls/TestControl.php'));
9796
}
98-
}
97+
}

tests/Unit/StubsTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ public function test_stubs_correctly_registered(): void
1212

1313
$this->assertEquals(
1414
[
15-
'/app/src/Console/stubs/control.stub' => 'controller.stub',
16-
'/app/src/Console/stubs/perimeter.plain.stub' => 'perimeter.plain.stub',
17-
'/app/src/Console/stubs/perimeter.overlay.stub' => 'perimeter.overlay.stub'
15+
'/app/src/Console/stubs/control.stub' => 'controller.stub',
16+
'/app/src/Console/stubs/perimeter.plain.stub' => 'perimeter.plain.stub',
17+
'/app/src/Console/stubs/perimeter.overlay.stub' => 'perimeter.overlay.stub',
1818
],
1919
$event->stubs
2020
);
2121
}
22-
}
22+
}

0 commit comments

Comments
 (0)