mirror of
https://github.com/pestphp/pest.git
synced 2026-03-07 16:27:23 +01:00
31 lines
671 B
PHP
31 lines
671 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Pest\Plugins;
|
|
|
|
use Pest\Contracts\Plugins\HandlesArguments;
|
|
use Pest\Plugins\Concerns\HandleArguments;
|
|
|
|
/**
|
|
* @internal
|
|
*/
|
|
final class Bail implements HandlesArguments
|
|
{
|
|
use HandleArguments;
|
|
|
|
/**
|
|
* Handles the arguments, adding the `--stop-on-defect` when the `--bail` argument is present.
|
|
*/
|
|
public function handleArguments(array $arguments): array
|
|
{
|
|
if ($this->hasArgument('--bail', $arguments)) {
|
|
$arguments = $this->popArgument('--bail', $arguments);
|
|
|
|
$arguments = $this->pushArgument('--stop-on-defect', $arguments);
|
|
}
|
|
|
|
return $arguments;
|
|
}
|
|
}
|