Constructors signature and LSP

“Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.” – Barbara Liskov

From time to time we all encounter oddity of the language that we use and the feeling of strangeness of course is simply caused by some gaps in our knowledge. When I was building some CLI commands for my Magento’s module I found that I must extend Symfony’s Command class. Nihil novi sub sole, however I also wanted to inject my custom ThemeInstaller class to delegate some responsibilities. Then I realized that I will not be able to do that…

Continue reading “Constructors signature and LSP”