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

Provide does not satisfy package requirement if package with same name exists #6753

Closed
naderman opened this issue Oct 18, 2017 · 1 comment
Closed
Labels
Milestone

Comments

@naderman
Copy link
Member

naderman commented Oct 18, 2017

I believe this should be allowed. It works if you swap replace/provide.

{
	"repositories": [
		{
			"packagist": false
		},
		{
			"type": "package",
			"package": [
				{
					"name": "foo/polyfill",
					"provide": {
						"foo/standard": "1.0.0"
					},
					"replace": {
					},
					"version": "1.0.0"
				},
				{
					"name": "foo/standard",
					"require": {
						"foo/does-not-exist": "1.0.0"
					},
					"version": "1.0.0"
				}
			],
			"type": "package"
		}
	],
	"require": {
		"foo/standard": "1.0.0",
		"foo/polyfill": "1.0.0"
	}
}
@naderman
Copy link
Member Author

naderman commented Oct 19, 2017

At least in the current implementation it is very intentional:

// if a package with the required name exists, we ignore providers
if ($nameMatch) {
return $matches;
}
return array_merge($matches, $provideMatches);

However I think this doesn't hold for extensions being provided by a PHP package, as that array entry is not set for extension names. Which is at the very least inconsistent.

@Seldaek Seldaek modified the milestones: 2.0, 2.0-core Jan 30, 2019
Seldaek added a commit to Seldaek/composer that referenced this issue Jan 30, 2020
…ng packages which do not satisfy requirements, fixes composer#6753
Seldaek added a commit to Seldaek/composer that referenced this issue Jan 30, 2020
…ng packages which do not satisfy requirements, fixes composer#6753
Seldaek added a commit to Seldaek/composer that referenced this issue Jan 30, 2020
…ng packages which do not satisfy requirements, fixes composer#6753
Seldaek added a commit to Seldaek/composer that referenced this issue Jan 30, 2020
…ng packages which do not satisfy requirements, fixes composer#6753
@Seldaek Seldaek closed this as completed Jan 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants