Library/ClassDefinition.php
public function getConstant($constantName)
    {
        if (!\is_string($constantName)) {
            throw new InvalidArgumentException('$constantName must be string type');
        }

        if (empty($constantName)) {
            throw new InvalidArgumentException('$constantName must not be empty: '.$constantName);
        }

        if (isset($this->constants[$constantName])) {
            return $this->constants[$constantName];
        }

        $extendsClassDefinition = $this->getExtendsClassDefinition();
        if ($extendsClassDefinition) {
            if ($extendsClassDefinition->hasConstant($constantName)) {
                return $extendsClassDefinition->getConstant($constantName);
            }
        }

        /*
         * Gets constant from interfaces
         */
        return $this->getConstantFromInterfaces($constantName);
    }
public function getConstant($constantName)
    {
        if (!\is_string($constantName)) {
            throw new InvalidArgumentException('$constantName must be string type');
        }

        if (empty($constantName)) {
            throw new InvalidArgumentException('$constantName must not be empty: '.$constantName);
        }

        if (isset($this->constants[$constantName])) {
            return $this->constants[$constantName];
        }

        $extendsClassDefinition = $this->getExtendsClassDefinition();
        if ($extendsClassDefinition) {
            if ($extendsClassDefinition->hasConstant($constantName)) {
                return $extendsClassDefinition->getConstant($constantName);
            }
        }

        /*
         * Gets constant from interfaces
         */
        return $this->getConstantFromInterfaces($constantName);
    }
public function getConstant ( $ constantName ) { if ( ! \ is_string ( $ constantName ) ) { throw new InvalidArgumentException ( '$constantName must be string type' ) ; } if ( empty ( $ constantName ) ) { throw new InvalidArgumentException ( '$constantName must not be empty: ' . $ constantName ) ; } if ( isset ( $ this -> constants [ $ constantName ] ) ) { return $ this -> constants [ $ constantName ] ; } $ extendsClassDefinition = $ this -> getExtendsClassDefinition ( ) ; if ( $ extendsClassDefinition ) { if ( $ extendsClassDefinition -> hasConstant ( $ constantName ) ) { return $ extendsClassDefinition -> getConstant ( $ constantName ) ; } } /*
         * Gets constant from interfaces
         */ return $ this -> getConstantFromInterfaces ( $ constantName ) ; }
Returns a constant definition by its name.

@param string $constantName

@return bool|ClassConstant

@throws InvalidArgumentException
Returns a constant definition by its name .