Is there a roadmap to make the code SOLID?

There are some mistakes in the framework that sometimes make it impossible to write clean code. I’m wondering whether there is an interest to improve the design and whether I can contribute to that.

Example:
The cache StorageFactory is supposed to return a StorageInterface, but the actual adapters implement a whole bunch of other interfaces. This means that I can’t safely inject cache as a dependency.


I’m not here to point fingers or judge. I just want to help make it better so that I can write cleaner code for my clients.

An AbstractAdapter is implementing StorageInterface though?

https://github.com/laminas/laminas-cache/blob/a06d45d27b6438342bb769e0d3872ce7e24d8fb5/src/Storage/Adapter/AbstractAdapter.php#L26

I had a thorough discussion with @xerkus on the subject. Here are our conclusions.

  • The overall design in that particular example is good. It is I who misunderstood something.
  • It would be beneficial for the various capability interfaces to extend StorageInterface.
  • The documentation needs an overhaul to provide modern examples, including some more complex ones.
  • I’ll open a PR to progressively write the new cache doc.
3 Likes