Then change implementation to use what is in interface & not use shortcut:
```php
$session->getBag('flashes')->add();