2021-03-06 22:05:14 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @template-covariant T as object
|
|
|
|
*
|
|
|
|
* @property-read class-string<T> $name
|
|
|
|
*/
|
|
|
|
class ReflectionClass implements Reflector {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var class-string<T>
|
|
|
|
*/
|
|
|
|
public $name;
|
|
|
|
|
|
|
|
/**
|
2021-07-17 00:38:39 +02:00
|
|
|
* @param T|class-string<T>|interface-string<T>|trait-string $argument
|
2021-03-06 22:05:14 +01:00
|
|
|
*/
|
|
|
|
public function __construct($argument) {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return class-string<T>
|
|
|
|
*/
|
2021-03-06 22:54:23 +01:00
|
|
|
public function getName(): string {}
|
2021-03-06 22:05:14 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed ...$args
|
|
|
|
*
|
|
|
|
* @return T
|
|
|
|
*/
|
|
|
|
public function newInstance(...$args): object {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param array<int, mixed> $args
|
|
|
|
*
|
|
|
|
* @return T
|
|
|
|
*/
|
|
|
|
public function newInstanceArgs(array $args): object {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return T
|
|
|
|
*/
|
2021-03-06 22:54:23 +01:00
|
|
|
public function newInstanceWithoutConstructor(): object {}
|
2021-03-06 22:05:14 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return ?array<string>
|
|
|
|
* @psalm-ignore-nullable-return
|
|
|
|
*/
|
|
|
|
public function getTraitNames(): array {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @since 8.0
|
|
|
|
* @template TClass as object
|
|
|
|
* @param class-string<TClass>|null $name
|
2021-12-20 09:57:06 +01:00
|
|
|
* @return ($name is null ? array<ReflectionAttribute<object>> : array<ReflectionAttribute<TClass>>)
|
2021-03-06 22:05:14 +01:00
|
|
|
*/
|
|
|
|
public function getAttributes(?string $name = null, int $flags = 0): array {}
|
|
|
|
}
|
|
|
|
|
|
|
|
class ReflectionFunction implements Reflector
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @since 8.0
|
|
|
|
* @template TClass as object
|
|
|
|
* @param class-string<TClass>|null $name
|
2021-12-20 10:19:01 +01:00
|
|
|
* @return ($name is null ? array<ReflectionAttribute<object>> : array<ReflectionAttribute<TClass>>)
|
2021-03-06 22:05:14 +01:00
|
|
|
*/
|
|
|
|
public function getAttributes(?string $name = null, int $flags = 0): array {}
|
|
|
|
}
|
|
|
|
|
|
|
|
class ReflectionProperty implements Reflector
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @since 8.0
|
|
|
|
* @template TClass as object
|
|
|
|
* @param class-string<TClass>|null $name
|
2021-12-20 10:19:01 +01:00
|
|
|
* @return ($name is null ? array<ReflectionAttribute<object>> : array<ReflectionAttribute<TClass>>)
|
2021-03-06 22:05:14 +01:00
|
|
|
*/
|
|
|
|
public function getAttributes(?string $name = null, int $flags = 0): array {}
|
2021-04-06 12:29:30 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @since 7.4
|
|
|
|
* @psalm-assert-if-true ReflectionType $this->getType()
|
|
|
|
*/
|
|
|
|
public function hasType() : bool {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @since 7.4
|
|
|
|
* @psalm-mutation-free
|
|
|
|
*/
|
|
|
|
public function getType() : ?ReflectionType {}
|
2021-03-06 22:05:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
class ReflectionMethod implements Reflector
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @since 8.0
|
|
|
|
* @template TClass as object
|
|
|
|
* @param class-string<TClass>|null $name
|
2021-12-20 10:19:01 +01:00
|
|
|
* @return ($name is null ? array<ReflectionAttribute<object>> : array<ReflectionAttribute<TClass>>)
|
2021-03-06 22:05:14 +01:00
|
|
|
*/
|
|
|
|
public function getAttributes(?string $name = null, int $flags = 0): array {}
|
2021-12-14 20:04:33 +01:00
|
|
|
|
|
|
|
public function isStatic(): bool {}
|
2021-03-06 22:05:14 +01:00
|
|
|
}
|
|
|
|
|
2022-01-06 01:55:55 +01:00
|
|
|
class ReflectionClassConstant implements Reflector
|
2021-03-06 22:05:14 +01:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @since 8.0
|
|
|
|
* @template TClass as object
|
|
|
|
* @param class-string<TClass>|null $name
|
2021-12-20 10:19:01 +01:00
|
|
|
* @return ($name is null ? array<ReflectionAttribute<object>> : array<ReflectionAttribute<TClass>>)
|
2021-03-06 22:05:14 +01:00
|
|
|
*/
|
|
|
|
public function getAttributes(?string $name = null, int $flags = 0): array {}
|
|
|
|
}
|
2021-03-06 22:54:23 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @psalm-immutable
|
|
|
|
*/
|
2022-01-06 01:55:55 +01:00
|
|
|
class ReflectionParameter implements Reflector {
|
2021-03-06 22:54:23 +01:00
|
|
|
/**
|
|
|
|
* @psalm-assert-if-true ReflectionType $this->getType()
|
|
|
|
*/
|
|
|
|
public function hasType() : bool {}
|
|
|
|
|
|
|
|
public function getType() : ?ReflectionType {}
|
2022-02-24 01:50:05 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @since 8.0
|
|
|
|
* @template TClass as object
|
|
|
|
* @param class-string<TClass>|null $name
|
|
|
|
* @return ($name is null ? array<ReflectionAttribute<object>> : array<ReflectionAttribute<TClass>>)
|
|
|
|
*/
|
|
|
|
public function getAttributes(?string $name = null, int $flags = 0): array {}
|
2021-03-06 22:54:23 +01:00
|
|
|
}
|
2021-10-14 00:09:52 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @psalm-immutable
|
|
|
|
*/
|
|
|
|
class ReflectionNamedType extends ReflectionType
|
|
|
|
{
|
|
|
|
public function getName(): string {}
|
|
|
|
|
2021-10-14 00:35:54 +02:00
|
|
|
/**
|
|
|
|
* @psalm-assert-if-false class-string $this->getName()
|
|
|
|
*/
|
2021-10-14 00:09:52 +02:00
|
|
|
public function isBuiltin(): bool {}
|
|
|
|
}
|