first commit
This commit is contained in:
21
vendor/spatie/backtrace/src/Arguments/ReducedArgument/VariadicReducedArgument.php
vendored
Normal file
21
vendor/spatie/backtrace/src/Arguments/ReducedArgument/VariadicReducedArgument.php
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Spatie\Backtrace\Arguments\ReducedArgument;
|
||||
|
||||
use Exception;
|
||||
|
||||
class VariadicReducedArgument extends ReducedArgument
|
||||
{
|
||||
public function __construct(array $value)
|
||||
{
|
||||
foreach ($value as $key => $item) {
|
||||
if (! $item instanceof ReducedArgument) {
|
||||
throw new Exception('VariadicReducedArgument must be an array of ReducedArgument');
|
||||
}
|
||||
|
||||
$value[$key] = $item->value;
|
||||
}
|
||||
|
||||
parent::__construct($value, 'array');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user