/** * @param string $path * @return ConfigFile * @throws InvalidArgumentException if $path is invalid (can't be read for whatever reason) */ public static function createFromFile($path) { if (!is_readable($path)) { throw new InvalidArgumentException(sprintf("Config-file is not readable: '%s'", $path)); } $configFile = new static(); $configFile->loadFile($path); return $configFile; }
/** * @param string $path * @return ConfigFile * @throws InvalidArgumentException if $path is invalid (can't be read for whatever reason) */ public static function createFromFile($path) { $configFile = new static(); $configFile->loadFile($path); return $configFile; }