-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
helpers.php
32 lines (27 loc) · 874 Bytes
/
helpers.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/*
* This file is part of the PHPFlasher package.
* (c) Younes KHOUBZA <younes.khoubza@gmail.com>
*/
use Flasher\Notyf\Prime\NotyfFactory;
use Flasher\Prime\Container\FlasherContainer;
use Flasher\Prime\Notification\Envelope;
use Flasher\Prime\Notification\NotificationInterface;
if (!function_exists('notyf')) {
/**
* @param string $message
* @param string $type
* @param array<string, mixed> $options
*
* @return Envelope|NotyfFactory
*/
function notyf($message = null, $type = NotificationInterface::SUCCESS, array $options = array())
{
/** @var NotyfFactory $factory */
$factory = FlasherContainer::create('flasher.notyf');
if (0 === func_num_args()) {
return $factory;
}
return $factory->addFlash($type, $message, $options);
}
}