-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathfunctions.php
More file actions
27 lines (21 loc) · 733 Bytes
/
functions.php
File metadata and controls
27 lines (21 loc) · 733 Bytes
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
<?php
declare(strict_types=1);
namespace Flasher\Prime;
use Flasher\Prime\Container\FlasherContainer;
use Flasher\Prime\Notification\Envelope;
use Flasher\Prime\Notification\Type;
if (!\function_exists('Flasher\Prime\flash')) {
/**
* @param array<string, mixed> $options
*
* @phpstan-return ($message is empty ? FlasherInterface : Envelope)
*/
function flash(?string $message = null, string $type = Type::SUCCESS, array $options = [], ?string $title = null): Envelope|FlasherInterface
{
$factory = FlasherContainer::create('flasher');
if (0 === \func_num_args()) {
return $factory;
}
return $factory->flash($type, $message, $options, $title);
}
}