protected function filterExtension(string $extension): string
    {
        $extension = $this->filterString($extension);
        if (0 === strpos($extension, '.') || false !== strpos($extension, '/')) {
            throw new Exception(
                'extension must be string sequence without a leading `.` and the path separator `/` characters'
            );
        }

        return trim($extension);
    }