diff --git a/src/Reflection/ReflectionDecoratedFunction.php b/src/Reflection/ReflectionDecoratedFunction.php index cb8b628..0a61ba1 100644 --- a/src/Reflection/ReflectionDecoratedFunction.php +++ b/src/Reflection/ReflectionDecoratedFunction.php @@ -23,126 +23,176 @@ class ReflectionDecoratedFunction extends \ReflectionFunction $this->reflection = reflect($decorated); } + #[\ReturnTypeWillChange] + public function inNamespace() { return $this->reflection->inNamespace(); } + #[\ReturnTypeWillChange] + public function isClosure() { return $this->reflection->isVariadic(); } + #[\ReturnTypeWillChange] + public function isDeprecated() { return $this->reflection->isDeprecated(); } + #[\ReturnTypeWillChange] + public function isInternal() { return $this->reflection->isInternal(); } + #[\ReturnTypeWillChange] + public function isUserDefined() { return $this->reflection->isUserDefined(); } + #[\ReturnTypeWillChange] + public function getClosureThis() { return $this->reflection->getClosureThis(); } + #[\ReturnTypeWillChange] + public function getClosureScopeClass() { return $this->reflection->getClosureScopeClass(); } + #[\ReturnTypeWillChange] + public function getDocComment() { return $this->reflection->getDocComment(); } + #[\ReturnTypeWillChange] + public function getEndLine() { return $this->reflection->getEndLine(); } + #[\ReturnTypeWillChange] + public function getExtension() { return $this->reflection->getExtension(); } + #[\ReturnTypeWillChange] + public function getExtensionName() { return $this->reflection->getExtensionName(); } + #[\ReturnTypeWillChange] + public function getFileName() { return $this->reflection->getFileName(); } + #[\ReturnTypeWillChange] + public function getName() { return $this->reflection->getName(); } + #[\ReturnTypeWillChange] + public function getNamespaceName() { return $this->reflection->getNamespaceName(); } + #[\ReturnTypeWillChange] + public function getNumberOfParameters() { return $this->reflection->getNumberOfParameters(); } + #[\ReturnTypeWillChange] + public function getNumberOfRequiredParameters() { return $this->reflection->getNumberOfRequiredParameters(); } + #[\ReturnTypeWillChange] + public function getParameters() { return $this->reflection->getParameters(); } + #[\ReturnTypeWillChange] + public function getReturnType() { return $this->reflection->getReturnType(); } + #[\ReturnTypeWillChange] + public function getShortName() { return $this->reflection->getShortName(); } + #[\ReturnTypeWillChange] + public function getStartLine() { return $this->reflection->getStartLine(); } + #[\ReturnTypeWillChange] + public function getStaticVariables() { return $this->reflection->getStaticVariables(); } + #[\ReturnTypeWillChange] + public function hasReturnType() { return $this->reflection->hasReturnType(); } + #[\ReturnTypeWillChange] + public function returnsReference() { return $this->reflection->returnsReference(); } + #[\ReturnTypeWillChange] + public function isGenerator() { return $this->reflection->isGenerator(); } + #[\ReturnTypeWillChange] + public function isVariadic() { return $this->reflection->isVariadic(); diff --git a/src/Utils/CurriedFunction.php b/src/Utils/CurriedFunction.php index faa32a4..0994467 100644 --- a/src/Utils/CurriedFunction.php +++ b/src/Utils/CurriedFunction.php @@ -25,7 +25,7 @@ class CurriedFunction extends PartiallyAppliedFunction * @param int|null $threshold * @param array $args */ - public function __construct(callable $callable, int $threshold = null, ...$args) + public function __construct(callable $callable, ?int $threshold = null, ...$args) { parent::__construct($callable, ...$args); $this->threshold = $threshold ?: reflect($callable)->getNumberOfRequiredParameters(); @@ -36,7 +36,7 @@ class CurriedFunction extends PartiallyAppliedFunction return $this->threshold; } - public function withThreshold(int $threshold = null) + public function withThreshold(?int $threshold = null) { return new static($this, $threshold); } diff --git a/src/Utils/index.php b/src/Utils/index.php index 72ca5be..fa9ce3f 100644 --- a/src/Utils/index.php +++ b/src/Utils/index.php @@ -47,7 +47,7 @@ function apply(callable $callable, ...$args) } } -function curry(callable $callable, int $threshold = null, ...$args): CurriedFunction +function curry(callable $callable, ?int $threshold = null, ...$args): CurriedFunction { return new CurriedFunction($callable, $threshold, ...$args); }