BetterReflection\Reflection\ReflectionClass::getConstant PHP Method

getConstant() public method

Returns null if not specified.
public getConstant ( string $name ) : mixed | null
$name string
return mixed | null
    public function getConstant($name)
    {
        $constants = $this->getConstants();
        if (!isset($constants[$name])) {
            return null;
        }
        return $constants[$name];
    }

Usage Example

 /**
  * {@inheritDoc}
  */
 public function getConstant($name)
 {
     return $this->betterReflectionClass->getConstant($name);
 }