generated from nunomaduro/skeleton-php
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow passing through arguments to the command to be benchmarked...
a little quirk is that options for the benchmark command itself need to be before options passed to the command to be benchmarked
- Loading branch information
Showing
4 changed files
with
173 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
|
||
class TestWithArgumentsCommand extends Command | ||
{ | ||
protected $signature = ' | ||
with-arguments:test | ||
{custom-argument} | ||
{--custom-option} | ||
{--C|custom-option-with-shortcut} | ||
{--custom-option-with-value=} | ||
{--custom-option-array=*} | ||
'; | ||
|
||
public function handle(): void | ||
{ | ||
$this->line('Custom argument: '.$this->argument('custom-argument')); | ||
$this->line('Custom option: '.$this->option('custom-option')); | ||
$this->line('Custom option with shortcut: '.$this->option('custom-option-with-shortcut')); | ||
$this->line('Custom option with value: '.$this->option('custom-option-with-value')); | ||
$this->line('Custom option array: '.implode(', ', $this->option('custom-option-array'))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters