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; }
public function hasProperty(ClassReflection $classReflection, string $propertyName) : bool { return $classReflection->getName() === Html::class || $classReflection->isSubclassOf(Html::class); }
public function hasProperty(ClassReflection $classReflection, string $propertyName) : bool { return $classReflection->isSubclassOf(Node::class) && $classReflection->getNativeReflection()->hasProperty('name') && $propertyName === 'namespacedName'; }