Nette\Reflection\Property::getDeclaringClass PHP Метод

getDeclaringClass() публичный Метод

public getDeclaringClass ( ) : ClassType
Результат ClassType
    public function getDeclaringClass()
    {
        return new ClassType(parent::getDeclaringClass()->getName());
    }

Usage Example

Пример #1
0
 private function validateProperty(Property $property, array $ignore)
 {
     if (in_array($property->getDeclaringClass()->getName(), $ignore, TRUE)) {
         return FALSE;
     }
     foreach ($property->getAnnotations() as $name => $value) {
         if (!in_array(Strings::lower($name), ['autowire', 'autowired'], TRUE)) {
             continue;
         }
         if (Strings::lower($name) !== $name || $name !== 'autowire') {
             throw new UnexpectedValueException("Annotation @{$name} on {$property} should be fixed to lowercase @autowire.", $property);
         }
         if ($property->isPrivate()) {
             throw new MemberAccessException("Autowired properties must be protected or public. Please fix visibility of {$property} or remove the @autowire annotation.", $property);
         }
         return TRUE;
     }
     return FALSE;
 }