private function getParser(string $extension): ParserInterface
    {
        switch (true) {
            case $extension === 'json':
                return new JsonParser();
            case $extension[0] === 'i':
                return new IniParser();
            default:
                return new YamlParser();
        }
    }
private function getParser(string $extension): ParserInterface
    {
        switch (true) {
            case $extension === 'json':
                return new JsonParser();
            case $extension[0] === 'i':
                return new IniParser();
            default:
                return new YamlParser();
        }
    }
@param string $extension

@return ParserInterface