mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
first
This commit is contained in:
29
src/Actions/AddsDefaults.php
Normal file
29
src/Actions/AddsDefaults.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Pest\Actions;
|
||||
|
||||
use NunoMaduro\Collision\Adapters\Phpunit\Printer;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class AddsDefaults
|
||||
{
|
||||
/**
|
||||
* Adds default arguments to the given `arguments` array.
|
||||
*
|
||||
* @param array<string, mixed> $arguments
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public static function to(array $arguments): array
|
||||
{
|
||||
if (!array_key_exists('printer', $arguments)) {
|
||||
$arguments['printer'] = new Printer();
|
||||
}
|
||||
|
||||
return $arguments;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user