isSubclassOf() public method

public isSubclassOf ( string $className ) : boolean
$className string
return boolean
コード例 #1
0
 public function hasMethod(ClassReflection $classReflection, string $methodName) : bool
 {
     $traitNames = $this->getTraitNames($classReflection->getNativeReflection());
     if (!$classReflection->isSubclassOf(Object::class) && !in_array(\Nette\SmartObject::class, $traitNames, true)) {
         return false;
     }
     if (substr($methodName, 0, 2) !== 'on' || strlen($methodName) <= 2) {
         return false;
     }
     return $classReflection->hasProperty($methodName) && $classReflection->getProperty($methodName)->isPublic();
 }
 public function hasProperty(ClassReflection $classReflection, string $propertyName) : bool
 {
     if ($classReflection->getNativeReflection()->hasProperty($propertyName)) {
         return false;
     }
     foreach ($this->classes as $className) {
         if ($classReflection->getName() === $className || $classReflection->isSubclassOf($className)) {
             return true;
         }
     }
     return false;
 }
コード例 #3
0
 public function hasProperty(ClassReflection $classReflection, string $propertyName) : bool
 {
     return $classReflection->getName() === Html::class || $classReflection->isSubclassOf(Html::class);
 }
コード例 #4
0
 public function hasProperty(ClassReflection $classReflection, string $propertyName) : bool
 {
     return $classReflection->isSubclassOf(Node::class) && $classReflection->getNativeReflection()->hasProperty('name') && $propertyName === 'namespacedName';
 }