Skip to content

Commit c402dd2

Browse files
committed
docs: add type hints to docs
1 parent 8275a4e commit c402dd2

File tree

4 files changed

+6
-16
lines changed

4 files changed

+6
-16
lines changed

commands.md

+3-8
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,16 @@ class InspiringCommand extends Command
3131

3232
/**
3333
* Execute the console command.
34-
*
35-
* @return mixed
3634
*/
37-
public function handle()
35+
public function handle(): void
3836
{
3937
$this->info('Simplicity is the ultimate sophistication.');
4038
}
4139

4240
/**
4341
* Define the command's schedule.
44-
*
45-
* @param \Illuminate\Console\Scheduling\Schedule $schedule
46-
* @return void
4742
*/
48-
public function schedule(Schedule $schedule)
43+
public function schedule(Schedule $schedule): void
4944
{
5045
// $schedule->command(static::class)->everyMinute();
5146
}
@@ -71,7 +66,7 @@ The `description` property should contain one line description of your command's
7166

7267
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:
7368
```php
74-
public function handle(Service $service)
69+
public function handle(Service $service): void
7570
{
7671
$service->execute('foo');
7772

service-providers.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ app(Contract::class) // Returns a Concrete implementation.
2121

2222
This is useful, because you may want to ask for the contract instead of the implementation:
2323
```php
24-
public function handle(ServiceContract $service)
24+
public function handle(ServiceContract $service): void
2525
{
2626
$service->execute('foo');
2727
}

task-scheduling.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ need to add the following Cron entry to your server:
1616
You may define all of your scheduled tasks in the `schedule` method of the Artisan command:
1717

1818
```php
19-
public function schedule(Schedule $schedule)
19+
public function schedule(Schedule $schedule): void
2020
{
2121
$schedule->command(static::class)->everyMinute();
2222
}

web-browser-automation.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,7 @@ you can use Laravel Dusk for web tasks that should be automated. Let's take a lo
1515
```php
1616
class VisitLaravelZeroCommand extends Command
1717
{
18-
/**
19-
* Execute the console command.
20-
*
21-
* @return mixed
22-
*/
23-
public function handle()
18+
public function handle(): void
2419
{
2520
$this->browse(function ($browser) {
2621
$browser->visit('https://laravel-zero.com')

0 commit comments

Comments
 (0)