mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
refacto: --retry option
This commit is contained in:
37
src/Plugins/Cache.php
Normal file
37
src/Plugins/Cache.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Pest\Plugins;
|
||||
|
||||
use Pest\Contracts\Plugins\HandlesArguments;
|
||||
use Pest\Plugins\Concerns\HandleArguments;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class Cache implements HandlesArguments
|
||||
{
|
||||
use HandleArguments;
|
||||
|
||||
private const TEMPORARY_FOLDER = __DIR__
|
||||
.DIRECTORY_SEPARATOR
|
||||
.'..'
|
||||
.DIRECTORY_SEPARATOR
|
||||
.'..'
|
||||
.DIRECTORY_SEPARATOR
|
||||
.'.temp';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function handleArguments(array $arguments): array
|
||||
{
|
||||
$arguments = $this->pushArgument(
|
||||
sprintf('--cache-directory=%s', realpath(self::TEMPORARY_FOLDER)),
|
||||
$arguments
|
||||
);
|
||||
|
||||
return $this->pushArgument('--cache-result', $arguments);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user