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

ArrayLoader: fix integer index of branch alias #10660

Merged
merged 1 commit into from Mar 29, 2022

Conversation

glaubinix
Copy link
Contributor

Fixes Console Exception: strtolower(): Argument #1 ($string) must be of type string, int given in ArrayLoader.php:440

For example, happens for package "silverstripe/crontask" from packagist.org which has an extra key with value {"branch-alias":{"1":"1.3.x-dev"}} in version 1.x-dev

Comment on lines 368 to 369
$this->assertSame('2019', $package->getSourceReference());
$this->assertSame('2019', $package->getDistReference());
Copy link
Member

Choose a reason for hiding this comment

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

The assertion is wrong here, probably should check that we get an alias package with the expected version or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, copied this and never updated it. I adjusted the test and I am only calling the getBranchAlias method. I am not sure, I understand what you mean with the alias package. The branch alias will never match because 1 does not match a dev version.

@Seldaek
Copy link
Member

Seldaek commented Mar 26, 2022

Good find, super nasty these numeric array indices..

@Seldaek Seldaek added this to the 2.3 milestone Mar 26, 2022
@Seldaek Seldaek added the Bug label Mar 26, 2022
@glaubinix glaubinix force-pushed the f/branch-alias-numeric-array-index branch from a03f403 to 92e47ee Compare March 26, 2022 15:49
@glaubinix glaubinix force-pushed the f/branch-alias-numeric-array-index branch from 92e47ee to f1371d3 Compare March 26, 2022 15:50
@Seldaek Seldaek merged commit 9f8ee0e into composer:main Mar 29, 2022
@glaubinix glaubinix deleted the f/branch-alias-numeric-array-index branch March 29, 2022 10:37
emahorvat52 pushed a commit to emahorvat52/composer that referenced this pull request Feb 3, 2023
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

2 participants