File tree 4 files changed +6
-16
lines changed
4 files changed +6
-16
lines changed Original file line number Diff line number Diff line change @@ -31,21 +31,16 @@ class InspiringCommand extends Command
31
31
32
32
/**
33
33
* Execute the console command.
34
- *
35
- * @return mixed
36
34
*/
37
- public function handle()
35
+ public function handle(): void
38
36
{
39
37
$this->info('Simplicity is the ultimate sophistication.');
40
38
}
41
39
42
40
/**
43
41
* Define the command's schedule.
44
- *
45
- * @param \Illuminate\Console\Scheduling\Schedule $schedule
46
- * @return void
47
42
*/
48
- public function schedule(Schedule $schedule)
43
+ public function schedule(Schedule $schedule): void
49
44
{
50
45
// $schedule->command(static::class)->everyMinute();
51
46
}
@@ -71,7 +66,7 @@ The `description` property should contain one line description of your command's
71
66
72
67
The ` handle ` method is the place where the logic of your command should be. This method will be called when your command is executed. Note that we are able to inject any dependencies we need into the ` handle ` method:
73
68
``` php
74
- public function handle(Service $service)
69
+ public function handle(Service $service): void
75
70
{
76
71
$service->execute('foo');
77
72
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ app(Contract::class) // Returns a Concrete implementation.
21
21
22
22
This is useful, because you may want to ask for the contract instead of the implementation:
23
23
``` php
24
- public function handle(ServiceContract $service)
24
+ public function handle(ServiceContract $service): void
25
25
{
26
26
$service->execute('foo');
27
27
}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ need to add the following Cron entry to your server:
16
16
You may define all of your scheduled tasks in the ` schedule ` method of the Artisan command:
17
17
18
18
``` php
19
- public function schedule(Schedule $schedule)
19
+ public function schedule(Schedule $schedule): void
20
20
{
21
21
$schedule->command(static::class)->everyMinute();
22
22
}
Original file line number Diff line number Diff line change @@ -15,12 +15,7 @@ you can use Laravel Dusk for web tasks that should be automated. Let's take a lo
15
15
``` php
16
16
class VisitLaravelZeroCommand extends Command
17
17
{
18
- /**
19
- * Execute the console command.
20
- *
21
- * @return mixed
22
- */
23
- public function handle()
18
+ public function handle(): void
24
19
{
25
20
$this->browse(function ($browser) {
26
21
$browser->visit('https://laravel-zero.com')
You can’t perform that action at this time.
0 commit comments