protected function getConstants($category = null)
    {
        if (!$category) {
            return \get_defined_constants();
        }

        $consts = \get_defined_constants(true);

        if ($category === 'internal') {
            unset($consts['user']);

            return \call_user_func_array('array_merge', $consts);
        }

        return isset($consts[$category]) ? $consts[$category] : [];
    }
protected function getConstants($category = null)
    {
        if (!$category) {
            return \get_defined_constants();
        }

        $consts = \get_defined_constants(true);

        if ($category === 'internal') {
            unset($consts['user']);

            return \call_user_func_array('array_merge', $consts);
        }

        return isset($consts[$category]) ? $consts[$category] : [];
    }
protected function getConstants ( $ category = null ) { if ( ! $ category ) { return \ get_defined_constants ( ) ; } $ consts = \ get_defined_constants ( true ) ; if ( $ category === 'internal' ) { unset ( $ consts [ 'user' ] ) ; return \ call_user_func_array ( 'array_merge' , $ consts ) ; } return isset ( $ consts [ $ category ] ) ? $ consts [ $ category ] : [ ] ; }
Get defined constants.

Optionally restrict constants to a given category, e.g. "date". If the
category is "internal", include all non-user-defined constants.

@param string $category

@return array
Get defined constants .