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] : [];
    }