lib/Configuration.php
static function fromYaml(string $document): self {
    if (!mb_strlen($document)) throw new \InvalidArgumentException('The specified YAML document is empty.');

    try {
      $yaml = Yaml::parse($document);
      if (!is_array($yaml)) throw new \InvalidArgumentException('The specified YAML document is invalid.');
      return new static($yaml);
    }

    catch (ParseException $e) {
      throw new \InvalidArgumentException('The specified YAML document is invalid.', 0, $e);
    }
  }
static function fromYaml(string $document): self {
    if (!mb_strlen($document)) throw new \InvalidArgumentException('The specified YAML document is empty.');

    try {
      $yaml = Yaml::parse($document);
      if (!is_array($yaml)) throw new \InvalidArgumentException('The specified YAML document is invalid.');
      return new static($yaml);
    }

    catch (ParseException $e) {
      throw new \InvalidArgumentException('The specified YAML document is invalid.', 0, $e);
    }
  }
static function fromYaml ( string $ document ) : self { if ( ! mb_strlen ( $ document ) ) throw new \ InvalidArgumentException ( 'The specified YAML document is empty.' ) ; try { $ yaml = Yaml :: parse ( $ document ) ; if ( ! is_array ( $ yaml ) ) throw new \ InvalidArgumentException ( 'The specified YAML document is invalid.' ) ; return new static ( $ yaml ) ; } catch ( ParseException $ e ) { throw new \ InvalidArgumentException ( 'The specified YAML document is invalid.' , 0 , $ e ) ; } }
Creates a new configuration from the specified YAML document.
@param string $document A YAML document providing configuration parameters.
@return static The instance corresponding to the specified YAML document.
@throws \InvalidArgumentException The specified document is invalid.
Creates a new configuration from the specified YAML document .