{"action":"opened","issue":{"url":"https://api.github.com/repos/composer/composer/issues/6758","repository_url":"https://api.github.com/repos/composer/composer","labels_url":"https://api.github.com/repos/composer/composer/issues/6758/labels{/name}","comments_url":"https://api.github.com/repos/composer/composer/issues/6758/comments","events_url":"https://api.github.com/repos/composer/composer/issues/6758/events","html_url":"https://github.com/composer/composer/issues/6758","id":266931692,"number":6758,"title":"Default virtual package provider choices","user":{"login":"naderman","id":154844,"avatar_url":"https://avatars1.githubusercontent.com/u/154844?v=4","gravatar_id":"","url":"https://api.github.com/users/naderman","html_url":"https://github.com/naderman","followers_url":"https://api.github.com/users/naderman/followers","following_url":"https://api.github.com/users/naderman/following{/other_user}","gists_url":"https://api.github.com/users/naderman/gists{/gist_id}","starred_url":"https://api.github.com/users/naderman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naderman/subscriptions","organizations_url":"https://api.github.com/users/naderman/orgs","repos_url":"https://api.github.com/users/naderman/repos","events_url":"https://api.github.com/users/naderman/events{/privacy}","received_events_url":"https://api.github.com/users/naderman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-19T17:51:11Z","updated_at":"2017-10-19T17:51:11Z","closed_at":null,"author_association":"OWNER","body":"There should be a way to specify a default package to satisfy a requirement on a virtual package.\r\n\r\nFor example https://packagist.org/packages/knplabs/github-api requires php-http/client-implementation . So to install it you need to require at least the implementation and the package itself. Instead it should be possible for knplabs/github-api to state that by default php-http/guzzle6-adapter can be used to satisfy the requirement.\r\n\r\nThis solution would allow easier installation while keeping the promise of not installing a package that doesn't have a direct name-based require route from the root composer.json.\r\n\r\nI think the implementation would be quite simply, we'd introduce a new key in composer.json for this purpose and just need to make sure the package is loaded in the pool, as the solver will already work out that the package provides the required name.\r\n\r\n```\r\n    \"require\": {\r\n        \"php\": \"^5.5 || ^7.0\",\r\n        \"psr/http-message\": \"^1.0\",\r\n        \"psr/cache\": \"^1.0\",\r\n        \"php-http/httplug\": \"^1.1\",\r\n        \"php-http/discovery\": \"^1.0\",\r\n        \"php-http/client-implementation\": \"^1.0\",\r\n        \"php-http/client-common\": \"^1.3\",\r\n        \"php-http/cache-plugin\": \"^1.4\"\r\n    },\r\n    \"default-providers\": {\r\n        \"php-http/client-implementation\": {\r\n            \"php-http/guzzle6-adapter\": \"^1.0\"\r\n        }\r\n    }\r\n```"}}
{"actor":{"display_login":"naderman"}}