2022-03-17 20:48:29 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace CuyZ\Valinor\Tests\Fake\Definition;
|
|
|
|
|
|
|
|
use CuyZ\Valinor\Definition\EmptyAttributes;
|
|
|
|
use CuyZ\Valinor\Definition\FunctionDefinition;
|
|
|
|
use CuyZ\Valinor\Definition\ParameterDefinition;
|
|
|
|
use CuyZ\Valinor\Definition\Parameters;
|
|
|
|
use CuyZ\Valinor\Type\Types\NativeStringType;
|
2022-03-17 21:38:46 +01:00
|
|
|
use stdClass;
|
2022-03-17 20:48:29 +01:00
|
|
|
|
|
|
|
final class FakeFunctionDefinition
|
|
|
|
{
|
2022-04-06 18:21:13 +02:00
|
|
|
public static function new(string $fileName = null): FunctionDefinition
|
2022-03-17 20:48:29 +01:00
|
|
|
{
|
|
|
|
return new FunctionDefinition(
|
|
|
|
'foo',
|
|
|
|
'foo:42-1337',
|
2022-04-06 18:21:13 +02:00
|
|
|
$fileName ?? 'foo/bar',
|
2022-03-17 21:38:46 +01:00
|
|
|
stdClass::class,
|
2022-03-17 20:48:29 +01:00
|
|
|
new Parameters(
|
|
|
|
new ParameterDefinition(
|
|
|
|
'bar',
|
|
|
|
'foo::bar',
|
|
|
|
NativeStringType::get(),
|
|
|
|
false,
|
|
|
|
false,
|
|
|
|
'foo',
|
|
|
|
EmptyAttributes::get()
|
|
|
|
)
|
|
|
|
),
|
|
|
|
NativeStringType::get()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|