Phan\CodeBase::hasClassWithFQSEN PHP Method

hasClassWithFQSEN() public method

public hasClassWithFQSEN ( FullyQualifiedClassName $fqsen ) : boolean
$fqsen Phan\Language\FQSEN\FullyQualifiedClassName
return boolean True if an element with the given FQSEN exists
    public function hasClassWithFQSEN(FullyQualifiedClassName $fqsen) : bool
    {
        return !empty($this->fqsen_class_map[$fqsen]);
    }

Usage Example

Beispiel #1
0
 public function testMethodInCodeBase()
 {
     $context = $this->contextForCode("\n                namespace A;\n                Class B {\n                    public function c() {\n                        return 42;\n                    }\n                }\n            ");
     $class_fqsen = FullyQualifiedClassName::fromFullyQualifiedString('\\A\\b');
     self::assertTrue($this->code_base->hasClassWithFQSEN($class_fqsen), "Class with FQSEN {$class_fqsen} not found");
     $clazz = $this->code_base->getClassByFQSEN($class_fqsen);
     self::assertTrue($clazz->hasMethodWithName($this->code_base, 'c'), "Method with FQSEN not found");
 }
All Usage Examples Of Phan\CodeBase::hasClassWithFQSEN