monsieurbiz / SyliusSettingsPlugin

Provide some custom settings to your favorite Sylius shop!
MIT License
23 stars 18 forks source link

Use ShopperContextInterface instead of ShopperContext #40

Closed vvasiloi closed 3 years ago

vvasiloi commented 3 years ago

The setting TWIG function will always return null when the sylius global TWIG variable is not an instance of \Sylius\Component\Core\Context\ShopperContext, i.e. when a custom context is used. Instead, check if it implements Sylius\Component\Core\Context\ShopperContextInterface. Always try to rely on abstractions in libraries.

jacquesbh commented 3 years ago

Thanks a lot @vvasiloi!