mirror of
https://github.com/pestphp/pest.git
synced 2026-03-10 09:47:23 +01:00
Uses Collision ^7.0
This commit is contained in:
@ -19,6 +19,20 @@ trait HandleArguments
|
||||
return in_array($argument, $arguments, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the given argument and value to the list of arguments.
|
||||
*
|
||||
* @param array<int, string> $arguments
|
||||
*
|
||||
* @return array<int, string>
|
||||
*/
|
||||
public function pushArgument(string $argument, array $arguments): array
|
||||
{
|
||||
$arguments[] = $argument;
|
||||
|
||||
return $arguments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pops the given argument from the arguments.
|
||||
*
|
||||
|
||||
@ -14,7 +14,7 @@ final class Environment implements HandlesArguments
|
||||
/**
|
||||
* The continuous integration environment.
|
||||
*/
|
||||
public const CI = 'ci';
|
||||
public const CI = 'ci';
|
||||
|
||||
/**
|
||||
* The local environment.
|
||||
|
||||
27
src/Plugins/Printer.php
Normal file
27
src/Plugins/Printer.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Pest\Plugins;
|
||||
|
||||
use Pest\Contracts\Plugins\HandlesArguments;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class Printer implements HandlesArguments
|
||||
{
|
||||
use Concerns\HandleArguments;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function handleArguments(array $arguments): array
|
||||
{
|
||||
if (! array_key_exists('COLLISION_PRINTER', $_SERVER)) {
|
||||
return $arguments;
|
||||
}
|
||||
|
||||
return $this->pushArgument('--no-output', $arguments);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user