You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using MtHaml with Laravel 5 with the help of https://github.com/BKWLD/laravel-haml , and I've encountered a compatibility issue in the SCSS filter. I suspect there's a similar issue in the CoffeeScript filter, but haven't tested.
If I instantiate the SCSS filter inside the BKWLD/laravel-haml configuration, I get a PHP Fatal error when the configuration is cached:
Fatal error: Call to undefined method MtHaml\Filter\Scss::__set_state() in .../bootstrap/cache/config.php
On the other hand, if I specify only the filter class name, as it should be done, then the filter constructor fails because it expects the compiler class as a parameter.
The configuration handling is a BKWLD/laravel-haml issue, but the underlying problem is in MtHaml: it should be possible to instantiate all filters without parameters. If a compiler is not provided, it should create a default compiler instance automatically. The constructor should only throw if the compiler class is not found and can't be loaded.
Specifically with Laravel 5, it may be enough to add a type hint on the compiler parameter. Laravel should be able to inject the dependency on its own once it knows which class it needs.
The text was updated successfully, but these errors were encountered:
I'm using MtHaml with Laravel 5 with the help of https://github.com/BKWLD/laravel-haml , and I've encountered a compatibility issue in the SCSS filter. I suspect there's a similar issue in the CoffeeScript filter, but haven't tested.
If I instantiate the SCSS filter inside the BKWLD/laravel-haml configuration, I get a PHP Fatal error when the configuration is cached:
On the other hand, if I specify only the filter class name, as it should be done, then the filter constructor fails because it expects the compiler class as a parameter.
The configuration handling is a BKWLD/laravel-haml issue, but the underlying problem is in MtHaml: it should be possible to instantiate all filters without parameters. If a compiler is not provided, it should create a default compiler instance automatically. The constructor should only throw if the compiler class is not found and can't be loaded.
Specifically with Laravel 5, it may be enough to add a type hint on the compiler parameter. Laravel should be able to inject the dependency on its own once it knows which class it needs.
The text was updated successfully, but these errors were encountered: