mirror of
https://github.com/pestphp/pest.git
synced 2026-03-10 09:47:23 +01:00
feat: --bail
This commit is contained in:
30
src/Plugins/Bail.php
Normal file
30
src/Plugins/Bail.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user