mirror of
https://github.com/pestphp/pest.git
synced 2026-03-10 09:47:23 +01:00
Fixes --version and --help
This commit is contained in:
34
src/Plugins/Actions/CallsHandleArguments.php
Normal file
34
src/Plugins/Actions/CallsHandleArguments.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Pest\Plugins\Actions;
|
||||
|
||||
use Pest\Contracts\Plugins;
|
||||
use Pest\Plugin\Loader;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class CallsHandleArguments
|
||||
{
|
||||
/**
|
||||
* Executes the Plugin action.
|
||||
*
|
||||
* Transform the input arguments by passing it to the relevant plugins.
|
||||
*
|
||||
* @param array<int, string> $argv
|
||||
* @return array<int, string>
|
||||
*/
|
||||
public function __invoke(array $argv): array
|
||||
{
|
||||
$plugins = Loader::getPlugins(Plugins\HandlesArguments::class);
|
||||
|
||||
/** @var Plugins\HandlesArguments $plugin */
|
||||
foreach ($plugins as $plugin) {
|
||||
$argv = $plugin->handleArguments($argv);
|
||||
}
|
||||
|
||||
return $argv;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user