Клас ReflectionMethod

(PHP 5, PHP 7, PHP 8)

Вступ

КлассReflectionMethod повідомляє інформацію про методи.

Огляд класів


    
     class ReflectionMethod
    

    
     extends
      ReflectionFunctionAbstract
     {


    /* Константы */
    
     public
     const
     int
      IS_STATIC;

    public
     const
     int
      IS_PUBLIC;

    public
     const
     int
      IS_PROTECTED;

    public
     const
     int
      IS_PRIVATE;

    public
     const
     int
      IS_ABSTRACT;

    public
     const
     int
      IS_FINAL;


    /* Свойства */
    public
     string
      $class;


    /* Наследуемые свойства */
    public
     string
      $name;


    /* Методы */
    
   public __construct(object|string $objectOrMethod, string $method)
public __construct(string $classMethod)

    public static createFromMethodName(string $method): static
public static export(string $class, string $name, bool $return = false): string
public getClosure(?object $object = null): Closure
public getDeclaringClass(): ReflectionClass
public getModifiers(): int
public getPrototype(): ReflectionMethod
public hasPrototype(): bool
public invoke(?object $object, mixed ...$args): mixed
public invokeArgs(?object $object, array $args): mixed
public isAbstract(): bool
public isConstructor(): bool
public isDestructor(): bool
public isFinal(): bool
public isPrivate(): bool
public isProtected(): bool
public isPublic(): bool
public setAccessible(bool $accessible): void
public __toString(): string


    /* Наследуемые методы */
    private ReflectionFunctionAbstract::__clone(): void
public ReflectionFunctionAbstract::getAttributes(?string $name = null, int $flags = 0): array
public ReflectionFunctionAbstract::getClosureScopeClass(): ?ReflectionClass
public ReflectionFunctionAbstract::getClosureThis(): ?object
public ReflectionFunctionAbstract::getClosureUsedVariables(): array
public ReflectionFunctionAbstract::getDocComment(): string|false
public ReflectionFunctionAbstract::getEndLine(): int|false
public ReflectionFunctionAbstract::getExtension(): ?ReflectionExtension
public ReflectionFunctionAbstract::getExtensionName(): string|false
public ReflectionFunctionAbstract::getFileName(): string|false
public ReflectionFunctionAbstract::getName(): string
public ReflectionFunctionAbstract::getNamespaceName(): string
public ReflectionFunctionAbstract::getNumberOfParameters(): int
public ReflectionFunctionAbstract::getNumberOfRequiredParameters(): int
public ReflectionFunctionAbstract::getParameters(): array
public ReflectionFunctionAbstract::getReturnType(): ?ReflectionType
public ReflectionFunctionAbstract::getShortName(): string
public ReflectionFunctionAbstract::getStartLine(): int|false
public ReflectionFunctionAbstract::getStaticVariables(): array
public ReflectionFunctionAbstract::getTentativeReturnType(): ?ReflectionType
public ReflectionFunctionAbstract::hasReturnType(): bool
public ReflectionFunctionAbstract::hasTentativeReturnType(): bool
public ReflectionFunctionAbstract::inNamespace(): bool
public ReflectionFunctionAbstract::isClosure(): bool
public ReflectionFunctionAbstract::isDeprecated(): bool
public ReflectionFunctionAbstract::isGenerator(): bool
public ReflectionFunctionAbstract::isInternal(): bool
public ReflectionFunctionAbstract::isStatic(): bool
public ReflectionFunctionAbstract::isUserDefined(): bool
public ReflectionFunctionAbstract::isVariadic(): bool
public ReflectionFunctionAbstract::returnsReference(): bool
abstract public ReflectionFunctionAbstract::__toString(): void

   }

Властивості

name

Ім'я методу

class

Ім'я класу

Обумовлені константи

Модифікатори ReflectionMethod

ReflectionMethod::IS_STATIC

Вказує, що це статичний метод. До PHP 7.4.0, значення було

ReflectionMethod::IS_PUBLIC

Вказує, що це загальнодоступний метод. До PHP 7.4.0, значення було 256

ReflectionMethod::IS_PROTECTED

Вказує, що це захищений метод. До PHP 7.4.0, значення було 512

ReflectionMethod::IS_PRIVATE

Вказує, що це закритий метод. До PHP 7.4.0, значення було 1024

ReflectionMethod::IS_ABSTRACT

Вказує, що це абстрактний метод. До PHP 7.4.0, значення було

ReflectionMethod::IS_FINAL

Вказує, що це остаточний метод. До PHP 7.4.0, значення було 4

Зауваження :

Ці константи можуть змінюватися від версії до версії PHP. Рекомендується завжди використовувати константи і не покладатися безпосередньо на значення.

список змін

ВерсияОпис
8.0.0МетодReflectionMethod::export()був видалений.

Зміст