static function fromYaml($file) { if (!file_exists($file)) { throw new \InvalidArgumentException("Config file '{$file}' not found."); } $values = Yaml::parse(file_get_contents($file)); $config = new static($values, $file); return $config; }