In a recent article Théo Fidry covers a topic that’s become common with the use of Composer and various PHP packages: managing dependencies.
When you are creating a PHP application or library, you usually have 3 kinds of dependencies:
- Hard dependencies: what your application/library needs to be able to run
- Optional dependencies: for example a PHP library can provide a bridge for different frameworks
- Development dependencies: debugging tools, test frameworks…
He then works through several of the issues involved with using each including having too many dependencies, untestable dependencies and conflicts. He then counters these with some helpful suggestions around them including the use of phars and using multiple repositories to break down the package and make it easier to manage their dependencies.