1
0
Fork 0

Enhance the doc about provide to reduce mistakes

pull/9321/head
Christophe Coevoet 2020-10-22 15:13:01 +02:00 committed by GitHub
parent 7fda8433b1
commit 8e9262f129
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

View File

@ -442,9 +442,15 @@ that exact version, and not any other version, which would be incorrect.
#### provide #### provide
List of other packages that are provided by this package. This is mostly List of other packages that are provided by this package. This is mostly
useful for common interfaces. A package could depend on some virtual useful for implementations of common interfaces. A package could depend on
`logger` package, any library that implements this logger interface would some virtual `logger-implementation` package, any library that implements
simply list it in `provide`. this logger interface would simply list it in `provide`.
Using `provide` with the name of an actual package rather than a virtual one
implies that the code of that package is also shipped, in which case `replace`
is generally a better choice. A common convention for packages providing an
interface and relying on other packages to provide an implementation (for
instance the PSR interfaces) is to use a `-implementation` suffix for the
name of the virtual package corresponding to the interface package.
#### suggest #### suggest