Skip to content

Commit 78aaee4

Browse files
committed
Merge pull request #26 from php-http/avoid-duplication
cleanup virtual package doc
2 parents 043d26c + b7d042e commit 78aaee4

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

docs/httplug.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ Note: Until Httplug 1.0 becomes stable, we will focus on the Guzzle6 adapter.
2020

2121
## Usage in a project
2222

23-
When writing an application, you need to require a concrete [client implementation](https://packagist.org/providers/php-http/client-implementation). The client will in turn depend on `php-http/httplug`, thus you do not need to duplicate the dependency on `php-http/httplug` in your composer.json file. However, if your code depends on a minimal version of Httplug, specify it to have composer report problems rather than the application failing at some point.
23+
When writing an application, you need to require a concrete [client implementation](https://packagist.org/providers/php-http/client-implementation).
2424

25-
Choose the client based on your personal preferences or dependencies of your project. If your preferred client has no Httplug adapter, submit one.
25+
See [virtual package](virtual-package.md) for more information on the topic of working with HTTPlug implementations.
2626

2727

2828
## Installation in a reusable package

docs/virtual-package.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Virtual packages are a way to specify the dependency on an implementation of an
55
There is no project registered with that name. However, all client implementations including client adapters for Httplug use the `provide` section to tell composer that they do provide the client-implementation.
66

77

8-
# Using a Reusable Library
8+
# Using a Library that depends on HTTPlug
99

1010
Reusable libraries do not depend on a concrete implementation but only on the virtual package `php-http/client-implementation`. This is to avoid hard coupling and allows the user of the library to choose the implementation. You can think of this as an "interface" or "contract" for packages.
1111

@@ -27,6 +27,10 @@ Doing something like the following will make this problem go away:
2727
$ composer require php-http/guzzle6-adapter
2828
```
2929

30+
Pick a client based on your personal preferences or dependencies of your project. If your preferred client has no Httplug adapter, submit one.
31+
32+
The client will in turn depend on `php-http/httplug`, thus you do not need to duplicate the dependency on `php-http/httplug` in your composer.json file. However, if your code depends on a minimal version of Httplug, specify it to have composer report problems rather than the application failing at some point.
33+
3034

3135
# Building a Reusable Library
3236

0 commit comments

Comments
 (0)