Skip to content

Commit c4f7911

Browse files
authored
Improves PHP's Types Declarations (#16)
Signed-off-by: Mior Muhammad Zaki <[email protected]>
1 parent a739c9c commit c4f7911

10 files changed

+24
-36
lines changed

src/Console/BaseResourceCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ class BaseResourceCommand extends Command
2121
protected function configure()
2222
{
2323
$this->addGeneratorPresetOptions();
24+
25+
parent::configure();
2426
}
2527

2628
/** {@inheritDoc} */

src/Console/DashboardCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ class DashboardCommand extends Command
2121
protected function configure()
2222
{
2323
$this->addGeneratorPresetOptions();
24+
25+
parent::configure();
2426
}
2527

2628
/** {@inheritDoc} */

src/Console/FilterCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ class FilterCommand extends Command
2121
protected function configure()
2222
{
2323
$this->addGeneratorPresetOptions();
24+
25+
parent::configure();
2426
}
2527

2628
/** {@inheritDoc} */

src/Console/LensCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ class LensCommand extends Command
2121
protected function configure()
2222
{
2323
$this->addGeneratorPresetOptions();
24+
25+
parent::configure();
2426
}
2527

2628
/** {@inheritDoc} */

src/Console/PolicyMakeCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ class PolicyMakeCommand extends Command
2121
protected function configure()
2222
{
2323
$this->addGeneratorPresetOptions();
24+
25+
parent::configure();
2426
}
2527

2628
/** {@inheritDoc} */

src/Console/ResourceCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ class ResourceCommand extends Command
2121
protected function configure()
2222
{
2323
$this->addGeneratorPresetOptions();
24+
25+
parent::configure();
2426
}
2527

2628
/** {@inheritDoc} */

src/DevTool.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,8 @@ public static function resourcesIn(string $directory): void
4444

4545
/**
4646
* Register all of the resource classes within Workbench.
47-
*
48-
* @return void
4947
*/
50-
public static function resourcesInWorkbench()
48+
public static function resourcesInWorkbench(): void
5149
{
5250
static::resourcesIn(Workbench::path(['app', 'Nova']));
5351
}

src/DevToolServiceProvider.php

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@ class DevToolServiceProvider extends ServiceProvider
2121
{
2222
/**
2323
* Register services.
24-
*
25-
* @return void
2624
*/
27-
public function register()
25+
public function register(): void
2826
{
2927
if (! $this->app->runningInConsole()) {
3028
return;
@@ -60,10 +58,8 @@ public function register()
6058

6159
/**
6260
* Register the `nova:action` command.
63-
*
64-
* @return void
6561
*/
66-
protected function registerActionCommand()
62+
protected function registerActionCommand(): void
6763
{
6864
$this->app->singleton(ActionCommand::class, function ($app) {
6965
return new Console\ActionCommand($app['files']);
@@ -72,10 +68,8 @@ protected function registerActionCommand()
7268

7369
/**
7470
* Register the `nova:dashboard` command.
75-
*
76-
* @return void
7771
*/
78-
protected function registerDashboardCommand()
72+
protected function registerDashboardCommand(): void
7973
{
8074
$this->app->singleton(DashboardCommand::class, function ($app) {
8175
return new Console\DashboardCommand($app['files']);
@@ -84,10 +78,8 @@ protected function registerDashboardCommand()
8478

8579
/**
8680
* Register the `nova:base-resource` command.
87-
*
88-
* @return void
8981
*/
90-
protected function registerBaseResourceCommand()
82+
protected function registerBaseResourceCommand(): void
9183
{
9284
$this->app->singleton(BaseResourceCommand::class, function ($app) {
9385
return new Console\BaseResourceCommand($app['files']);
@@ -96,10 +88,8 @@ protected function registerBaseResourceCommand()
9688

9789
/**
9890
* Register the `nova:filter` command.
99-
*
100-
* @return void
10191
*/
102-
protected function registerFilterCommand()
92+
protected function registerFilterCommand(): void
10393
{
10494
$this->app->singleton(FilterCommand::class, function ($app) {
10595
return new Console\FilterCommand($app['files']);
@@ -108,10 +98,8 @@ protected function registerFilterCommand()
10898

10999
/**
110100
* Register the `nova:lens` command.
111-
*
112-
* @return void
113101
*/
114-
protected function registerLensCommand()
102+
protected function registerLensCommand(): void
115103
{
116104
$this->app->singleton(LensCommand::class, function ($app) {
117105
return new Console\LensCommand($app['files']);
@@ -120,10 +108,8 @@ protected function registerLensCommand()
120108

121109
/**
122110
* Register the `nova:policy` command.
123-
*
124-
* @return void
125111
*/
126-
protected function registerPolicyMakeCommand()
112+
protected function registerPolicyMakeCommand(): void
127113
{
128114
$this->app->singleton(PolicyMakeCommand::class, function ($app) {
129115
return new Console\PolicyMakeCommand($app['files']);
@@ -132,10 +118,8 @@ protected function registerPolicyMakeCommand()
132118

133119
/**
134120
* Register the `nova:resource` command.
135-
*
136-
* @return void
137121
*/
138-
protected function registerResourceCommand()
122+
protected function registerResourceCommand(): void
139123
{
140124
$this->app->singleton(ResourceCommand::class, function ($app) {
141125
return new Console\ResourceCommand($app['files']);
@@ -144,10 +128,8 @@ protected function registerResourceCommand()
144128

145129
/**
146130
* Bootstrap services.
147-
*
148-
* @return void
149131
*/
150-
public function boot()
132+
public function boot(): void
151133
{
152134
if ($this->app->runningInConsole() && defined('TESTBENCH_CORE')) {
153135
tap($this->app->make('events'), function (EventDispatcher $event) {

src/Listeners/InstalledWorkbench.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ public function __construct(public Filesystem $files)
2424

2525
/**
2626
* Handle the event.
27-
*
28-
* @return void
2927
*/
30-
public function handle(InstallEnded $event)
28+
public function handle(InstallEnded $event): void
3129
{
3230
$force = false;
3331

src/Listeners/InstallingWorkbench.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ public function __construct(public Filesystem $files)
1818

1919
/**
2020
* Handle the event.
21-
*
22-
* @return void
2321
*/
24-
public function handle(InstallStarted $event)
22+
public function handle(InstallStarted $event): void
2523
{
2624
if ($event->isBasicInstallation()) {
2725
throw new RuntimeException('Nova Devtool does not support installation with --basic` option');

0 commit comments

Comments
 (0)