Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --format option to composer fund command #9678

Merged
merged 3 commits into from Feb 24, 2021
Merged

Conversation

ochorocho
Copy link
Contributor

Hey,

currently building a little GUI around composer. I want to show funding information in the GUI.
Therefore i added --format option to the composer fund command which allows to output
fund details as JSON.

src/Composer/Command/FundCommand.php Outdated Show resolved Hide resolved
src/Composer/Command/FundCommand.php Outdated Show resolved Hide resolved
src/Composer/Command/FundCommand.php Outdated Show resolved Hide resolved
* Return empty json when no funding found instead of text
* Include all funding urls (do not override)
@ochorocho
Copy link
Contributor Author

@stof thanks for reviewing this.

@Seldaek Seldaek added this to the 2.1 milestone Feb 10, 2021
foreach ($fundings as $vendor => $links) {
$fundingJson[$vendor] = array();
foreach ($links as $url => $packages) {
$fundingJson[$vendor]['packages'] = $packages;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is still wrong. The list of packages is not per vendor but per url. Otherwise, you loose all except the ones of the last link.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stof makes sense. Instead of building my own array the existing one is now used. So the issue should be fixed.
May i ask for another review? :-)

@Seldaek Seldaek merged commit 91b6ff2 into composer:master Feb 24, 2021
@Seldaek
Copy link
Member

Seldaek commented Feb 24, 2021

Thanks!

johnstevenson pushed a commit to johnstevenson/composer that referenced this pull request Mar 1, 2021
* Add --format option to `composer fund` command

Co-authored-by: Jochen Roth <jochen.roth@b13.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants