/** * Load a configuration file. The file type is determined by its extension. * * Supported file types are `ini`, `json`, `yml`, `php`, `csv` * * @param string $filename A supported configuration file. * @throws InvalidArgumentException If the filename is invalid. * @return mixed The file content. */ public function loadFile($filename) { if (!is_string($filename)) { throw new InvalidArgumentException('Translation file must be a string.'); } if (!file_exists($filename)) { throw new InvalidArgumentException(sprintf('Translation file "%s" does not exist', $filename)); } $ext = pathinfo($filename, PATHINFO_EXTENSION); if ($ext === 'csv') { return $this->loadCsvFile($filename); } else { return parent::loadFile($filename); } }