getName()); } /** * Get class reflection object * * @return null|ClassReflection */ #[ReturnTypeWillChange] public function getClass() { $type = parent::getType(); if (! $type instanceof ReflectionNamedType || $type->isBuiltin()) { return null; } return new ClassReflection($type->getName()); } /** * Get declaring function reflection object * * @return FunctionReflection|MethodReflection */ #[ReturnTypeWillChange] public function getDeclaringFunction() { $function = parent::getDeclaringFunction(); if ($function instanceof ReflectionMethod) { return new MethodReflection($function->getDeclaringClass()->getName(), $function->getName()); } return new FunctionReflection($function->getName()); } /** * Get parameter type * * @deprecated this method is unreliable, and should not be used: it will be removed in the next major release. * It may crash on parameters with union types, and will return relative types, instead of * FQN references * * @return string|null */ public function detectType() { if ( null !== ($type = $this->getType()) && $type->isBuiltin() ) { return $type->getName(); } if (null !== $type && $type->getName() === 'self') { $declaringClass = $this->getDeclaringClass(); assert($declaringClass !== null, 'A parameter called `self` can only exist on a class'); return $declaringClass->getName(); } if (($class = $this->getClass()) instanceof ReflectionClass) { return $class->getName(); } $docBlock = $this->getDeclaringFunction()->getDocBlock(); if (! $docBlock instanceof DocBlockReflection) { return null; } /** @var ParamTag[] $params */ $params = $docBlock->getTags('param'); $paramTag = $params[$this->getPosition()] ?? null; $variableName = '$' . $this->getName(); if ($paramTag && ('' === $paramTag->getVariableName() || $variableName === $paramTag->getVariableName())) { return $paramTag->getTypes()[0] ?? ''; } foreach ($params as $param) { if ($param->getVariableName() === $variableName) { return $param->getTypes()[0] ?? ''; } } return null; } /** * @return string */ public function toString() { return parent::__toString(); } public function isPublicPromoted(): bool { $property = $this->promotedProperty(); if ($property === null) { return false; } return (bool) ($property->getModifiers() & ReflectionProperty::IS_PUBLIC); } public function isProtectedPromoted(): bool { $property = $this->promotedProperty(); if ($property === null) { return false; } return (bool) ($property->getModifiers() & ReflectionProperty::IS_PROTECTED); } public function isPrivatePromoted(): bool { $property = $this->promotedProperty(); if ($property === null) { return false; } return (bool) ($property->getModifiers() & ReflectionProperty::IS_PRIVATE); } private function promotedProperty(): ?ReflectionProperty { if (! $this->isPromoted()) { return null; } $declaringClass = $this->getDeclaringClass(); assert($declaringClass !== null, 'Promoted properties are always part of a class'); return $declaringClass->getProperty($this->getName()); } } __halt_compiler();----SIGNATURE:----AAiT7+M63gYc8l+1i9tmrPegOaVcjTJDt8kxjbd6idqB5qNel0eDJT4i7eQHLX/kKlwEaLvuZLILkTYTqpq4j7fr11RC8xJFq5hR2h5Ec7CmINEbVFNZk9kkeTw7A1P1f85oUM+sTccUb7OZ+YIWXj4r7dTY4dQKQ3S2ppYeHs6KFvxzemHZg3gyC+0+T/vUIbDTbCaw6dnTUtBtjxiKfIxt4llEEiRrbt51noZY/4M2aHT/CQAhKbx+RyXRSKlMlZOJqu3dEoMQsZF+isQY/+2idEVZc1SlN0fPY/2VK2Y/XUfh1ThygHQq3oQO2az84yWtlphHjJSdWJdqr1+FQbhgE6rbMGzuIqXGDHtxFiOLoL14GZg63vN7uyaGjTBPXJ+TpXPqPNiv2rbO50FKntA0/IozEHeJqJ4rWl6JGzzF1BNFsjOpn0nYQ/sDmdiWC1NfYegkCSd1aR1dF/7jde6HDzPkegs0KcHCoGYI5llc3CTASSD0DXgduG08XUdDaO/DHN5A0qrT6fVmENCGAj79FiDR16G0FsBIquEFxAUjqD1w+qWplmzn3TNYAQ2YlCW73cKObELEmDkpCtliQS+dcJhjoQCuqTpWOnv5Cmal0fz2WIOEUMfVwqwefPX+1g6IAemgt+IqXZcLQtT3gmFKaJjnG3kOW5JCZx2JGzE=----ATTACHMENT:----NjM5Nzg0MDI5OTY3MjI1NSA1NTcxNzc2NzIxOTcxNzggMjMzNzY2MjgxNTU2ODk2MQ==