0

I've got a number of SMS providers, each in a separate directory in the file system. The main class inside each provider directory extends abstract class ProviderAbstract.php which is located elsewhere in the filesystem and outside the provider directories.

I want to make each provider a separate composer package so it can be developed, tested and deployed independently. The problem is the ProviderAbstract class that each provider extends... what is the best approach in this situation? having a copy of the class inside each Provider package isn't the solution.. what is the best approach to resolve this type of dependency..

Thanks in advance

zoro74
  • 171
  • 15

1 Answers1

0

I don't know if this is the correct way. If you have a log at e.g. Monolog or Swiftmailer, they all have the "Providers" inside their one composer package. They can develop one Provider without looking at the others, testing them and deploy the whole package afterwards. If you decide to put components so small into own composer packages, you will end up with much overhead.

However, if you want to go on with that, you could extract the abstract class into it's own composer package and have all the other packages have this as a dependency. This is the way the PSR3 logger interface is used.

Sgoettschkes
  • 13,141
  • 5
  • 60
  • 78