Reflection ReflectionClass 클래스
(PHP 5, PHP 7, PHP 8)
소개
ReflectionClass 클래스는 클래스에 대한 정보를 보고합니다.
클래스 개요
class ReflectionClass implements Reflector {
/* Constants */
const int IS_IMPLICIT_ABSTRACT = 16;
const int IS_EXPLICIT_ABSTRACT = 32;
const int IS_FINAL = 64;
/* Properties */
public string $name;
/* Methods */
public __construct(object|string $objectOrClass)
public static export(mixed $argument, bool $return = false): string
public getAttributes(?string $name = null, int $flags = 0): array
public getConstant(string $name): mixed
public getConstants(?int $filter = null): array
public getConstructor(): ?ReflectionMethod
public getDefaultProperties(): array
public getDocComment(): string|false
public getEndLine(): int|false
public getExtension(): ?ReflectionExtension
public getExtensionName(): string|false
public getFileName(): string|false
public getInterfaceNames(): array
public getInterfaces(): array
public getMethod(string $name): ReflectionMethod
public getMethods(?int $filter = null): array
public getModifiers(): int
public getName(): string
public getNamespaceName(): string
public getParentClass(): ReflectionClass|false
public getProperties(?int $filter = null): array
public getProperty(string $name): ReflectionProperty
public getReflectionConstant(string $name): ReflectionClassConstant|false
public getReflectionConstants(?int $filter = null): array
public getShortName(): string
public getStartLine(): int|false
public getStaticProperties(): ?array
public getStaticPropertyValue(string $name, mixed &$def_value = ?): mixed
public getTraitAliases(): array
public getTraitNames(): array
public getTraits(): array
public hasConstant(string $name): bool
public hasMethod(string $name): bool
public hasProperty(string $name): bool
public implementsInterface(ReflectionClass|string $interface): bool
public inNamespace(): bool
public isAbstract(): bool
public isAnonymous(): bool
public isCloneable(): bool
public isEnum(): bool
public isFinal(): bool
public isInstance(object $object): bool
public isInstantiable(): bool
public isInterface(): bool
public isInternal(): bool
public isIterable(): bool
public isSubclassOf(ReflectionClass|string $class): bool
public isTrait(): bool
public isUserDefined(): bool
public newInstance(mixed ...$args): object
public newInstanceArgs(array $args = []): ?object
public newInstanceWithoutConstructor(): object
public setStaticPropertyValue(string $name, mixed $value): void
public __toString(): string
}
Properties
- name
- 클래스의 이름입니다. 읽기 전용, 쓰기 시도 시 ReflectionException이 발생합니다.
미리 정의된 상수
ReflectionClass 수정자
ReflectionClass::IS_IMPLICIT_ABSTRACT
- 추상 메서드가 있기 때문에 abstract 클래스를 나타냅니다.
ReflectionClass::IS_EXPLICIT_ABSTRACT
- 정의 때문에 abstract 클래스를 나타냅니다.
ReflectionClass::IS_FINAL
- final 클래스를 나타냅니다.
목차
- ReflectionClass::__construct — ReflectionClass를 생성합니다.
- ReflectionClass::export — 클래스 내보내기
- ReflectionClass::getAttributes — 속성 가져오기
- ReflectionClass::getConstant — 정의된 상수 가져오기
- ReflectionClass::getConstants — 상수 가져오기
- ReflectionClass::getConstructor — 클래스의 생성자를 가져옵니다.
- ReflectionClass::getDefaultProperties — 기본 속성 가져오기
- ReflectionClass::getDocComment — 문서 주석 가져오기
- ReflectionClass::getEndLine — 마지막 라인을 얻습니다
- ReflectionClass::getExtension — 클래스를 정의한 확장에 대한 ReflectionExtension 개체를 가져옵니다.
- ReflectionClass::getExtensionName — 클래스를 정의한 확장의 이름을 가져옵니다.
- ReflectionClass::getFileName — 클래스가 정의된 파일의 파일 이름을 가져옵니다.
- ReflectionClass::getInterfaceNames — 인터페이스 이름을 가져옵니다.
- ReflectionClass::getInterfaces — 인터페이스를 가져옵니다.
- ReflectionClass::getMethod — 클래스 메서드에 대한 ReflectionMethod를 가져옵니다.
- ReflectionClass::getMethods — 메서드 배열을 가져옵니다.
- ReflectionClass::getModifiers — 클래스 수정자를 가져옵니다.
- ReflectionClass::getName — 클래스 이름 가져오기
- ReflectionClass::getNamespaceName — 네임스페이스 이름 가져오기
- ReflectionClass::getParentClass — 부모 클래스 가져오기
- ReflectionClass::getProperties — 속성 가져오기
- ReflectionClass::getProperty — 클래스 속성에 대한 ReflectionProperty를 가져옵니다.
- ReflectionClass::getReflectionConstant — 클래스의 상수에 대한 ReflectionClassConstant를 가져옵니다.
- ReflectionClass::getReflectionConstants — 클래스 상수를 가져옵니다.
- ReflectionClass::getShortName — 짧은 이름을 가져옵니다
- ReflectionClass::getStartLine — 시작 줄 번호를 가져옵니다.
- ReflectionClass::getStaticProperties — 정적 속성 가져오기
- ReflectionClass::getStaticPropertyValue — 정적 속성 값을 가져옵니다.
- ReflectionClass::getTraitAliases — 특성 별칭의 배열을 반환합니다.
- ReflectionClass::getTraitNames — 이 클래스에서 사용하는 특성 이름의 배열을 반환합니다.
- ReflectionClass::getTraits — 이 클래스에서 사용하는 특성의 배열을 반환합니다.
- ReflectionClass::hasConstant — 상수가 정의되었는지 확인
- ReflectionClass::hasMethod — 메소드가 정의되어 있는지 확인
- ReflectionClass::hasProperty — 속성이 정의되어 있는지 확인
- ReflectionClass::implementsInterface — 인터페이스 구현
- ReflectionClass::inNamespace — 네임스페이스에 있는지 확인
- ReflectionClass::isAbstract — 클래스가 추상인지 확인
- ReflectionClass::isAnonymous — 클래스가 익명인지 확인
- ReflectionClass::isCloneable — 이 클래스가 복제 가능한지 여부를 반환합니다.
- ReflectionClass::isEnum — 이것이 enum인지 여부를 반환합니다.
- ReflectionClass::isFinal — 클래스가 final인지 확인
- ReflectionClass::isInstance — Checks class for instance
- ReflectionClass::isInstantiable — 클래스가 인스턴스화 가능한지 확인
- ReflectionClass::isInterface — 클래스가 인터페이스인지 확인
- ReflectionClass::isInternal — 클래스가 확장 또는 코어에 의해 내부적으로 정의되었는지 확인합니다.
- ReflectionClass::isIterable — 이 클래스가 반복 가능한지 확인
- ReflectionClass::isIterateable — ReflectionClass::isIterable의 별칭
- ReflectionClass::isSubclassOf — 하위 클래스인지 확인
- ReflectionClass::isTrait — Returns whether this is a trait
- ReflectionClass::isUserDefined — 사용자 정의 여부 확인
- ReflectionClass::newInstance — 주어진 인수에서 새 클래스 인스턴스를 만듭니다.
- ReflectionClass::newInstanceArgs — 주어진 인수에서 새 클래스 인스턴스를 만듭니다.
- ReflectionClass::newInstanceWithoutConstructor — 생성자를 호출하지 않고 새 클래스 인스턴스를 만듭니다.
- ReflectionClass::setStaticPropertyValue — 정적 속성 값 설정
- ReflectionClass::__toString — ReflectionClass 객체의 문자열 표현을 반환합니다.