Skip to content

Commit

Permalink
docs: add type hints to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
owenvoke committed Feb 6, 2023
1 parent 8275a4e commit c402dd2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 16 deletions.
11 changes: 3 additions & 8 deletions commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,16 @@ class InspiringCommand extends Command

/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
public function handle(): void
{
$this->info('Simplicity is the ultimate sophistication.');
}

/**
* Define the command's schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
public function schedule(Schedule $schedule)
public function schedule(Schedule $schedule): void
{
// $schedule->command(static::class)->everyMinute();
}
Expand All @@ -71,7 +66,7 @@ The `description` property should contain one line description of your command's

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:
```php
public function handle(Service $service)
public function handle(Service $service): void
{
$service->execute('foo');

Expand Down
2 changes: 1 addition & 1 deletion service-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ app(Contract::class) // Returns a Concrete implementation.

This is useful, because you may want to ask for the contract instead of the implementation:
```php
public function handle(ServiceContract $service)
public function handle(ServiceContract $service): void
{
$service->execute('foo');
}
Expand Down
2 changes: 1 addition & 1 deletion task-scheduling.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ need to add the following Cron entry to your server:
You may define all of your scheduled tasks in the `schedule` method of the Artisan command:

```php
public function schedule(Schedule $schedule)
public function schedule(Schedule $schedule): void
{
$schedule->command(static::class)->everyMinute();
}
Expand Down
7 changes: 1 addition & 6 deletions web-browser-automation.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@ you can use Laravel Dusk for web tasks that should be automated. Let's take a lo
```php
class VisitLaravelZeroCommand extends Command
{
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
public function handle(): void
{
$this->browse(function ($browser) {
$browser->visit('https://laravel-zero.com')
Expand Down

0 comments on commit c402dd2

Please sign in to comment.