This commit is contained in:
2026-06-26 21:57:07 +08:00
parent 3daa4021ec
commit 2239a34681
2 changed files with 3 additions and 105 deletions
+3 -3
View File
@@ -19,8 +19,9 @@ class DeferProxyGenerator
/**
* @param string $className
* @param array $construct
* @param array $construct
* @return object
* @throws \ReflectionException
*/
public static function create(string $className, array $construct): object
{
@@ -60,6 +61,7 @@ class DeferProxyGenerator
/**
* @param string $className
* @return string
* @throws \ReflectionException
*/
private static function generate(string $className): string
{
@@ -195,7 +197,6 @@ class DeferProxyGenerator
$value = $param->getDefaultValue();
return match (true) {
is_null($value) => new Expr\ConstFetch(new Name('null')),
is_bool($value) => new Expr\ConstFetch(new Name($value ? 'true' : 'false')),
is_int($value) => new Node\Scalar\LNumber($value),
is_float($value) => new Node\Scalar\DNumber($value),
@@ -218,7 +219,6 @@ class DeferProxyGenerator
private static function buildDefaultValueFromScalar(mixed $value): Node\Expr
{
return match (true) {
is_null($value) => new Expr\ConstFetch(new Name('null')),
is_bool($value) => new Expr\ConstFetch(new Name($value ? 'true' : 'false')),
is_int($value) => new Node\Scalar\LNumber($value),
is_float($value) => new Node\Scalar\DNumber($value),