Use Laravel Contracts to Build a Laravel 5 Twig Package

Thanks for the informative post. I have some things I am a bit uncertain/ confused about.

If a contract is only the concept of an interface, why give an interface a different name with the term “contract”? Or is that the name given for the easy binding method Laravel offers?

Also the lines of code between the two “contracts” in your example of EventPusher and FanoutPusher(?) would need to be different somehow, wouldn’t they?

You say Blade offers its own methods for extension, then refer to the Twig Bridge. The one has nothing to do with the other, does it? Or does the Twig Bridge just hold one or more examples of a blade extension in it?

And is your use of the ViewFactory and View contracts the better way to build the actual Twig bridge? If yes, does that mean the version 0.7 of the Twig Bridge is a work around?

Last question, one of the strengths of Twig is its ability to compile the templates down to straight PHP files, which in turn can be cached in XCode caches like APC. Would this still be possible with your binding or even the Twig Bridge?

Thanks for any clarification in advance. :smile:

Scott