FundingYamlCodec
Parses and renders GitHub funding YAML metadata.
Methods
Renders a normalized funding profile into GitHub funding YAML.
Parses a GitHub funding YAML payload into a normalized profile.
Converts a normalized list into the compact YAML representation.
Normalizes a scalar-or-list YAML node into a string list.
Renders a normalized funding profile into GitHub funding YAML.
public
dump(FundingProfile
$profile) : string
Parameters
Description
the profile to render
Return values
Description
the YAML document contents
Parses a GitHub funding YAML payload into a normalized profile.
public
parse(
string|null
$contents) : FundingProfile
Parameters
$contents
:
string|null
Description
the YAML contents, or null when the file does not exist
Return values
Description
the normalized funding profile
Converts a normalized list into the compact YAML representation.
private
denormalizeList(
array<int, string>
$values) : string|array<int, string>
Parameters
$values
:
array<int, string>
Description
the normalized values
Return values
Description
the scalar-or-list YAML node
Normalizes a scalar-or-list YAML node into a string list.
private
normalizeList(
mixed
$value) : array<int, string>
Parameters
$value
:
mixed
Description
the YAML node to normalize
Return values
Description
the normalized string list