diff --git a/src/Laravel/FlasherServiceProvider.php b/src/Laravel/FlasherServiceProvider.php index 773315e3..74cf1c53 100644 --- a/src/Laravel/FlasherServiceProvider.php +++ b/src/Laravel/FlasherServiceProvider.php @@ -143,7 +143,9 @@ final class FlasherServiceProvider extends ServiceProvider $eventDispatcher = $app->make('flasher.event_dispatcher'); $session = $app->make('session'); - $storageBag = new StorageBag(new SessionBag($session)); // @phpstan-ignore-line + /** @phpstan-ignore-next-line */ + $storageBag = new StorageBag(new SessionBag($session)); + $criteria = $config->get('filter_criteria', array()); // @phpstan-ignore-line return new StorageManager($storageBag, $eventDispatcher, $criteria); // @phpstan-ignore-line @@ -159,8 +161,12 @@ final class FlasherServiceProvider extends ServiceProvider $eventDispatcher = new EventDispatcher(); $config = $app->make('flasher.config'); - $translator = new Translator($app->make('translator')); // @phpstan-ignore-line - $autoTranslate = $config->get('auto_translate', true); // @phpstan-ignore-line + /** @phpstan-ignore-next-line */ + $translator = new Translator($app->make('translator')); + + /** @phpstan-ignore-next-line */ + $autoTranslate = $config->get('auto_translate', true); + $translatorListener = new TranslationListener($translator, $autoTranslate); $eventDispatcher->addSubscriber($translatorListener); diff --git a/src/Prime/EventDispatcher/EventListener/PresetListener.php b/src/Prime/EventDispatcher/EventListener/PresetListener.php index 4b737226..57993bc6 100644 --- a/src/Prime/EventDispatcher/EventListener/PresetListener.php +++ b/src/Prime/EventDispatcher/EventListener/PresetListener.php @@ -38,9 +38,9 @@ final class PresetListener implements EventSubscriberInterface } /** - * @return void - * * @throws PresetNotFoundException + * + * @return void */ public function __invoke(PersistEvent $event) { @@ -58,9 +58,9 @@ final class PresetListener implements EventSubscriberInterface } /** - * @return void - * * @throws PresetNotFoundException + * + * @return void */ private function attachPresets(Envelope $envelope) { @@ -78,7 +78,7 @@ final class PresetListener implements EventSubscriberInterface 'type' => 'info', 'title' => null, 'message' => null, - 'options' => array() + 'options' => array(), ), $preset); if (null === $envelope->getType()) { diff --git a/src/Prime/Notification/NotificationBuilder.php b/src/Prime/Notification/NotificationBuilder.php index c46e1596..5a0d5089 100644 --- a/src/Prime/Notification/NotificationBuilder.php +++ b/src/Prime/Notification/NotificationBuilder.php @@ -436,7 +436,7 @@ class NotificationBuilder implements NotificationBuilderInterface { $flash = false; - if (\is_bool($parameters)) { // @phpstan-ignore-line + if (\is_bool($parameters)) { /** @phpstan-ignore-line */ $flash = $parameters; $parameters = array(); @trigger_error('Since php-flasher/flasher v1.5: automatically flashing a preset is deprecated and will be removed in v2.0. You should use addPreset() or chain the preset call with flash() instead.', \E_USER_DEPRECATED); diff --git a/src/Prime/Translation/Messages.php b/src/Prime/Translation/Messages.php index f9021372..d4872b53 100644 --- a/src/Prime/Translation/Messages.php +++ b/src/Prime/Translation/Messages.php @@ -9,7 +9,9 @@ namespace Flasher\Prime\Translation; final class Messages { - /** @var array */ + /** + * @var array + */ public static $ar = array( 'success' => 'نجاح', 'error' => 'خطأ', @@ -24,7 +26,9 @@ final class Messages 'resource' => 'الملف', ); - /** @var array */ + /** + * @var array + */ public static $en = array( 'success' => 'Success', 'error' => 'Error', @@ -39,7 +43,9 @@ final class Messages 'resource' => 'resource', ); - /** @var array */ + /** + * @var array + */ public static $fr = array( 'success' => 'Succès', 'error' => 'Erreur', diff --git a/src/Symfony/Bridge/FlasherBundle.php b/src/Symfony/Bridge/FlasherBundle.php index cc3c91e4..89c2013e 100644 --- a/src/Symfony/Bridge/FlasherBundle.php +++ b/src/Symfony/Bridge/FlasherBundle.php @@ -24,7 +24,6 @@ if (false) { /** @phpstan-ignore-line */ */ protected function flasherBuild(ContainerBuilder $container) { - } /** diff --git a/src/Symfony/Http/Request.php b/src/Symfony/Http/Request.php index 34ce794d..cdf6be7e 100644 --- a/src/Symfony/Http/Request.php +++ b/src/Symfony/Http/Request.php @@ -9,7 +9,6 @@ namespace Flasher\Symfony\Http; use Flasher\Prime\Http\RequestInterface; use Symfony\Component\HttpFoundation\Request as SymfonyRequest; -use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; use Symfony\Component\HttpFoundation\Session\Session; final class Request implements RequestInterface diff --git a/src/Symfony/Http/Response.php b/src/Symfony/Http/Response.php index 2266b838..4ba33b20 100644 --- a/src/Symfony/Http/Response.php +++ b/src/Symfony/Http/Response.php @@ -46,7 +46,7 @@ final class Response implements ResponseInterface { $contentType = $this->response->headers->get('Content-Type'); - if (!is_string($contentType)) { + if (!\is_string($contentType)) { return false; } @@ -60,7 +60,7 @@ final class Response implements ResponseInterface { $contentDisposition = $this->response->headers->get('Content-Disposition', ''); - if (!is_string($contentDisposition)) { + if (!\is_string($contentDisposition)) { return false; } @@ -74,7 +74,7 @@ final class Response implements ResponseInterface { $content = $this->response->getContent(); - return is_string($content) ? $content : ''; + return \is_string($content) ? $content : ''; } /** diff --git a/tests/Laravel/TranslatorTest.php b/tests/Laravel/TranslatorTest.php index 671541af..e0251ce2 100644 --- a/tests/Laravel/TranslatorTest.php +++ b/tests/Laravel/TranslatorTest.php @@ -1,5 +1,10 @@ + */ + namespace Flasher\Tests\Laravel; use Flasher\Laravel\Translation\Translator;