protected function getConstants(\Reflector $reflector, $noInherit = false)
    {
        $className = $reflector->getName();

        $constants = [];
        foreach ($reflector->getConstants() as $name => $constant) {
            $constReflector = ReflectionClassConstant::create($reflector->name, $name);

            if ($noInherit && $constReflector->getDeclaringClass()->getName() !== $className) {
                continue;
            }

            $constants[$name] = $constReflector;
        }

        \ksort($constants, SORT_NATURAL | SORT_FLAG_CASE);

        return $constants;
    }
protected function getConstants(\Reflector $reflector, $noInherit = false)
    {
        $className = $reflector->getName();

        $constants = [];
        foreach ($reflector->getConstants() as $name => $constant) {
            $constReflector = ReflectionClassConstant::create($reflector->name, $name);

            if ($noInherit && $constReflector->getDeclaringClass()->getName() !== $className) {
                continue;
            }

            $constants[$name] = $constReflector;
        }

        \ksort($constants, SORT_NATURAL | SORT_FLAG_CASE);

        return $constants;
    }
protected function getConstants ( \ Reflector $ reflector , $ noInherit = false ) { $ className = $ reflector -> getName ( ) ; $ constants = [ ] ; foreach ( $ reflector -> getConstants ( ) as $ name => $ constant ) { $ constReflector = ReflectionClassConstant :: create ( $ reflector -> name , $ name ) ; if ( $ noInherit && $ constReflector -> getDeclaringClass ( ) -> getName ( ) !== $ className ) { continue ; } $ constants [ $ name ] = $ constReflector ; } \ ksort ( $ constants , SORT_NATURAL | SORT_FLAG_CASE ) ; return $ constants ; }
Get defined constants for the given class or object Reflector.

@param \Reflector $reflector
@param bool       $noInherit Exclude inherited constants

@return array
Get defined constants for the given class or object Reflector .