chore: coding style changes

This commit is contained in:
nuno maduro
2026-08-07 14:52:56 +01:00
parent eb88513baf
commit 42d9b777bf
221 changed files with 139 additions and 3086 deletions
+1 -29
View File
@@ -24,8 +24,6 @@ use ReflectionUnionType;
final class Reflection
{
/**
* Calls the given method with args on the given object.
*
* @param array<int, mixed> $args
*/
public static function call(object $object, string $method, array $args = []): mixed
@@ -50,8 +48,6 @@ final class Reflection
}
/**
* Bind a callable to the TestCase and return the result.
*
* @param array<int, mixed> $args
*/
public static function bindCallable(callable $callable, array $args = []): mixed
@@ -59,10 +55,6 @@ final class Reflection
return Closure::fromCallable($callable)->bindTo(TestSuite::getInstance()->test)(...$args);
}
/**
* Bind a callable to the TestCase and return the result,
* passing in the current dataset values as arguments.
*/
public static function bindCallableWithData(callable $callable): mixed
{
$test = TestSuite::getInstance()->test;
@@ -80,9 +72,6 @@ final class Reflection
return Closure::fromCallable($callable)->bindTo($test)(...$test->providedData());
}
/**
* Infers the file name from the given closure.
*/
public static function getFileNameFromClosure(Closure $closure): string
{
$reflectionClosure = new ReflectionFunction($closure);
@@ -90,9 +79,6 @@ final class Reflection
return (string) $reflectionClosure->getFileName();
}
/**
* Gets the property value from of the given object.
*/
public static function getPropertyValue(object $object, string $property): mixed
{
$reflectionClass = new ReflectionClass($object);
@@ -116,8 +102,6 @@ final class Reflection
}
/**
* Sets the property value of the given object.
*
* @template TValue of object
*
* @param TValue $object
@@ -145,8 +129,6 @@ final class Reflection
}
/**
* Get the class name of the given parameter's type, if possible.
*
* @see https://github.com/laravel/framework/blob/v6.18.25/src/Illuminate/Support/Reflector.php
*/
public static function getParameterClassName(ReflectionParameter $parameter): ?string
@@ -175,8 +157,6 @@ final class Reflection
}
/**
* Receive a map of function argument names to their types.
*
* @return array<string, string>
*/
public static function getFunctionArguments(Closure $function): array
@@ -197,7 +177,7 @@ final class Reflection
$arguments[$parameter->getName()] = implode('|', array_map(
static fn (ReflectionNamedType $type): string => $type->getName(), // @phpstan-ignore-line
($types instanceof ReflectionNamedType)
? [$types] // NOTE: normalize as list of to handle unions
? [$types]
: $types->getTypes(),
));
}
@@ -211,10 +191,6 @@ final class Reflection
}
/**
* Get the properties from the given reflection class.
*
* Used by `expect()->toHavePropertiesDocumented()`.
*
* @param ReflectionClass<object> $reflectionClass
* @return array<int, ReflectionProperty>
*/
@@ -246,10 +222,6 @@ final class Reflection
}
/**
* Get the methods from the given reflection class.
*
* Used by `expect()->toHaveMethodsDocumented()`.
*
* @param ReflectionClass<object> $reflectionClass
* @return array<int, ReflectionMethod>
*/