Closed Saeven closed 2 years ago
That code is hacky as hell.
Let's first remove the assertion, but we should really just get rid of such janky consteuct 😬
Hey Marco, yeah I stopped short of using janky, but it's how it felt!
From a design contract point of view, I can appreciate wanting to protect the implementation - but none of it really fits. Protecting an implementation rather than its contract (non-existent in this case) seemed a bit sketchy.
I'm ready to pitch in - would you like
Hope you're doing well!
Cheers. Alex
Let's start from the first one 👍
Feature Request
Summary
An assertion was added to Layout::getViewModelHelper() which prohibits OSS implementations of RendererInterface in the wild, for example, Twig's TwigRenderer.
Adding plugin() to RendererInterface seems a bit heavy handed, but relaxing the assertion to an interface would seem to be more logical, specially since the assertion only serves to protect the contract for ->plugin
Proposal
Would you be open to accepting a PR that either proposes to substitute this assertion for one that looks for an interface that provides plugin() (couldn't find an existing one), or one that adds
plugin
to RendererInterface (implemented by PhpRenderer)?