protected function getReaderByExtension($location)
    {
        $ext = pathinfo($location, PATHINFO_EXTENSION);

        $reader = null;

        switch ($ext) {
            case 'json':
                $reader = new JsonConfigReader();
                break;
            case 'xml':
                $reader = new XmlConfigReader();
                break;
            case 'php':
                $reader = new PhpConfigReader();
                break;
            default:
                throw new \InvalidArgumentException(
                    'File could not be read: ' . $location . PHP_EOL .
                    'Supported config file extensions are: ' . implode(', ', $this->supported_file_extensions)
                );
                break;
        }

        return $reader;
    }