Reflection ReflectionMethod 클래스

(PHP 5, PHP 7, PHP 8)


소개

ReflectionMethod 클래스는 메서드에 대한 정보를 보고합니다.


클래스 개요

                  
class ReflectionMethod extends ReflectionFunctionAbstract {

  /* Constants */
  const int IS_STATIC = 16;
  const int IS_PUBLIC = 1;
  const int IS_PROTECTED = 2;
  const int IS_PRIVATE = 4;
  const int IS_ABSTRACT = 64;
  const int IS_FINAL = 32;

  /* Properties */
  public string $class;

  /* Inherited properties */
  public string $name;

  /* Methods */
  public __construct(object|string $objectOrMethod, string $method)
  public __construct(string $classMethod)
  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 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 isStatic(): bool
  public setAccessible(bool $accessible): void
  public __toString(): string

  /* Inherited methods */
  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::isUserDefined(): bool
  public ReflectionFunctionAbstract::isVariadic(): bool
  public ReflectionFunctionAbstract::returnsReference(): bool
  abstract public ReflectionFunctionAbstract::__toString(): void
}
                  
                

Properties

name
메소드 이름
class
클래스 이름

미리 정의된 상수


ReflectionMethod 수정자

ReflectionMethod::IS_STATIC
메서드가 정적임을 나타냅니다. PHP 7.4.0 이전에는 값이 1이었습니다.
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 이전에는 값이 2였습니다.
ReflectionMethod::IS_FINAL
메서드가 최종적임을 나타냅니다. PHP 7.4.0 이전에는 값이 4였습니다.

메모: 이러한 상수의 값은 PHP 버전 간에 변경될 수 있습니다. 항상 상수를 사용하고 값에 직접 의존하지 않는 것이 좋습니다.


목차