Phan\CodeBase::hasClassConstantWithFQSEN PHP Method

hasClassConstantWithFQSEN() public method

public hasClassConstantWithFQSEN ( FullyQualifiedClassConstantName $fqsen ) : boolean
$fqsen Phan\Language\FQSEN\FullyQualifiedClassConstantName
return boolean True if an element with the given FQSEN exists
    public function hasClassConstantWithFQSEN(FullyQualifiedClassConstantName $fqsen) : bool
    {
        return $this->getClassMapByFQSEN($fqsen)->hasClassConstantWithName($fqsen->getNameWithAlternateId());
    }

Usage Example

Example #1
0
File: Clazz.php Project: etsy/phan
 /**
  * @return bool
  * True if a constant with the given name is defined
  * on this class.
  */
 public function hasConstantWithName(CodeBase $code_base, string $name) : bool
 {
     return $code_base->hasClassConstantWithFQSEN(FullyQualifiedClassConstantName::make($this->getFQSEN(), $name));
 }