Synchronizes funding metadata between composer.json and .github/FUNDING.yml.
'funding'
'Synchronizes funding metadata between composer.json and .github/FUNDING.yml.'
'This command merges supported funding entries across composer.json and .github/FUNDING.yml while preserving unsupported providers.'
Interfaces
Defines the logger contract consumed by reusable command result helpers.
Properties
Methods
Creates a new FundingCommand instance.
Adds the standard JSON output options to the current command.
Configures command options.
Synchronizes funding metadata across Composer and GitHub files.
Determines whether JSON output was requested.
Determines whether pretty JSON output was requested.
Logs a failed command result and returns the failure exit code.
Handles composer.json synchronization reporting and writes.
Handles .github/FUNDING.yml synchronization reporting and writes.
Normalizes a composer manifest after funding metadata changes.
Logs an informational command message at notice level.
Prompts whether a managed file should be written.
Logs a successful command result and returns the success exit code.
private
ComposerFundingCodec
$composerFundingCodec
private
FileDiffer
$fileDiffer
private
FilesystemInterface
$filesystem
private
FundingProfileMerger
$fundingProfileMerger
private
FundingYamlCodec
$fundingYamlCodec
private
LoggerInterface
$logger
private
ProcessBuilderInterface
$processBuilder
private
ProcessQueueInterface
$processQueue
Creates a new FundingCommand instance.
public
__construct(FilesystemInterface
$filesystem, ComposerFundingCodec
$composerFundingCodec, FundingYamlCodec
$fundingYamlCodec, FundingProfileMerger
$fundingProfileMerger, FileDiffer
$fileDiffer, ProcessBuilderInterface
$processBuilder, ProcessQueueInterface
$processQueue, LoggerInterface
$logger) : mixed
Parameters
Description
the filesystem used to read and write funding metadata files
Description
the codec used to parse and render Composer funding metadata
Description
the codec used to parse and render GitHub funding YAML metadata
Description
the merger used to synchronize normalized funding profiles
Description
the differ used to summarize managed-file drift
Description
the process builder used to normalize composer.json after updates
Description
the process queue used to execute composer normalize
$logger
:
LoggerInterface
Description
the output-aware logger
Adds the standard JSON output options to the current command.
protected
addJsonOption() : static
Return values
Configures command options.
protected
configure() : void
Synchronizes funding metadata across Composer and GitHub files.
protected
execute(InputInterface
$input, OutputInterface
$output) : int
Parameters
$input
:
InputInterface
Description
the command input
$output
:
OutputInterface
Description
the command output
Return values
Description
the command status code
Determines whether JSON output was requested.
protected
isJsonOutput(InputInterface
$input) : bool
Description
The pretty-json flag SHALL imply JSON output.
Parameters
$input
:
InputInterface
Return values
Determines whether pretty JSON output was requested.
protected
isPrettyJsonOutput(InputInterface
$input) : bool
Parameters
$input
:
InputInterface
Return values
Logs a failed command result and returns the failure exit code.
private
failure(
string
$message, InputInterface
$input[,
array<string, mixed>
$context = []][,
string|null
$file = null][,
int|null
$line = null]) : int
Parameters
$message
:
string
Description
the failure message
$input
:
InputInterface
Description
the originating command input
$context
:
array<string, mixed>
=
[]
Description
optional extra log context
$file
:
string|null
=
null
Description
the related file path when known
$line
:
int|null
=
null
Description
the related line when known
Return values
Handles composer.json synchronization reporting and writes.
private
handleComposerFile(
string
$composerFile,
string
$composerContents,
string
$updatedComposerContents,
bool
$dryRun,
bool
$check,
bool
$interactive, InputInterface
$input, OutputInterface
$output) : int
Parameters
$composerFile
:
string
$composerContents
:
string
$updatedComposerContents
:
string
$dryRun
:
bool
$check
:
bool
$interactive
:
bool
$input
:
InputInterface
$output
:
OutputInterface
Return values
Description
the command status code
Handles .github/FUNDING.yml synchronization reporting and writes.
private
handleFundingFile(
string
$fundingFile,
string|null
$currentFundingContents,
string|null
$updatedFundingContents,
bool
$dryRun,
bool
$check,
bool
$interactive, InputInterface
$input, OutputInterface
$output) : int
Parameters
$fundingFile
:
string
$currentFundingContents
:
string|null
$updatedFundingContents
:
string|null
$dryRun
:
bool
$check
:
bool
$interactive
:
bool
$input
:
InputInterface
$output
:
OutputInterface
Return values
Description
the command status code
Normalizes a composer manifest after funding metadata changes.
private
normalizeComposerFile(
string
$composerFile, OutputInterface
$output) : int
Parameters
$composerFile
:
string
Description
the composer manifest path
$output
:
OutputInterface
Description
the command output
Return values
Description
the normalization status code
Logs an informational command message at notice level.
private
notice(
string
$message, InputInterface
$input[,
array<string, mixed>
$context = []]) : void
Parameters
$message
:
string
Description
the notice message
$input
:
InputInterface
Description
the originating command input
$context
:
array<string, mixed>
=
[]
Description
optional extra log context
Prompts whether a managed file should be written.
private
shouldWriteManagedFile(
string
$targetFile) : bool
Parameters
$targetFile
:
string
Return values
Description
true when the write SHOULD proceed
Logs a successful command result and returns the success exit code.
private
success(
string
$message, InputInterface
$input[,
array<string, mixed>
$context = []][,
string
$logLevel = LogLevel::INFO]) : int
Parameters
$message
:
string
Description
the success message
$input
:
InputInterface
Description
the originating command input
$context
:
array<string, mixed>
=
[]
Description
optional extra log context
$logLevel
:
string
=
LogLevel::INFO
Description
the PSR-3 log level used for the successful result