BootstrapFlashMessageImportanceMapper example

$browserChannel->notify($notification$recipient);
    }

    public static function defaultFlashMessageImportanceDataProvider(): array
    {
        return [
            [new DefaultFlashMessageImportanceMapper(), Notification::IMPORTANCE_URGENT, 'notification'],
            [new DefaultFlashMessageImportanceMapper(), Notification::IMPORTANCE_HIGH, 'notification'],
            [new DefaultFlashMessageImportanceMapper(), Notification::IMPORTANCE_MEDIUM, 'notification'],
            [new DefaultFlashMessageImportanceMapper(), Notification::IMPORTANCE_LOW, 'notification'],
            [new BootstrapFlashMessageImportanceMapper(), Notification::IMPORTANCE_URGENT, 'danger'],
            [new BootstrapFlashMessageImportanceMapper(), Notification::IMPORTANCE_HIGH, 'warning'],
            [new BootstrapFlashMessageImportanceMapper(), Notification::IMPORTANCE_MEDIUM, 'info'],
            [new BootstrapFlashMessageImportanceMapper(), Notification::IMPORTANCE_LOW, 'success'],
        ];
    }

    private function buildBrowserChannel(Session $session, FlashMessageImportanceMapperInterface $mapper): BrowserChannel
    {
        $request = $this->createMock(Request::class);
        $request->method('getSession')->willReturn($session);
        $requestStack = $this->createStub(RequestStack::class);
        
Home | Imprint | This part of the site doesn't use cookies.