@@ -34,7 +34,7 @@ |
||
34 | 34 | public function render(Laraflash $laraflash): string |
35 | 35 | { |
36 | 36 | return $laraflash->ready() |
37 | - ->map(function (FlashMessage $message) { |
|
37 | + ->map(function(FlashMessage $message) { |
|
38 | 38 | return $this->flashMessageRenderer->render($message); |
39 | 39 | }) |
40 | 40 | ->implode($this->getSeparator()); |
@@ -55,23 +55,23 @@ discard block |
||
55 | 55 | { |
56 | 56 | $message = $this->flashMessageFactory->make(); |
57 | 57 | |
58 | - if (! is_null($content)) { |
|
58 | + if (!is_null($content)) { |
|
59 | 59 | $message->content($content); |
60 | 60 | } |
61 | 61 | |
62 | - if (! is_null($title)) { |
|
62 | + if (!is_null($title)) { |
|
63 | 63 | $message->title($title); |
64 | 64 | } |
65 | 65 | |
66 | - if (! is_null($type)) { |
|
66 | + if (!is_null($type)) { |
|
67 | 67 | $message->type($type); |
68 | 68 | } |
69 | 69 | |
70 | - if (! is_null($delay)) { |
|
70 | + if (!is_null($delay)) { |
|
71 | 71 | $message->delay($delay); |
72 | 72 | } |
73 | 73 | |
74 | - if (! is_null($hops)) { |
|
74 | + if (!is_null($hops)) { |
|
75 | 75 | $message->hops($hops); |
76 | 76 | } |
77 | 77 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | public function keep(): self |
84 | 84 | { |
85 | - $this->messages->each(function (FlashMessage $message) { |
|
85 | + $this->messages->each(function(FlashMessage $message) { |
|
86 | 86 | $message->keep(); |
87 | 87 | }); |
88 | 88 | |
@@ -104,16 +104,16 @@ discard block |
||
104 | 104 | public function ready(): Collection |
105 | 105 | { |
106 | 106 | return $this->messages |
107 | - ->filter(function (FlashMessage $message) { |
|
107 | + ->filter(function(FlashMessage $message) { |
|
108 | 108 | return $message->get('delay') === 0; |
109 | 109 | }); |
110 | 110 | } |
111 | 111 | |
112 | 112 | public function touch(): self |
113 | 113 | { |
114 | - $this->messages = $this->messages->reject(function (FlashMessage $message) { |
|
114 | + $this->messages = $this->messages->reject(function(FlashMessage $message) { |
|
115 | 115 | return $message->get('hops') <= 1 && $message->get('delay') === 0; |
116 | - })->each(function (FlashMessage $message) { |
|
116 | + })->each(function(FlashMessage $message) { |
|
117 | 117 | if ($message->get('hops') > 1 && $message->get('delay') === 0) { |
118 | 118 | $message->hops($message->get('hops') - 1); |
119 | 119 | } elseif ($message->get('delay') > 0) { |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | public function toArray() |
128 | 128 | { |
129 | - return $this->ready()->map(function (FlashMessage $message) { |
|
129 | + return $this->ready()->map(function(FlashMessage $message) { |
|
130 | 130 | return $message->toArray(); |
131 | 131 | })->values()->all(); |
132 | 132 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | { |
36 | 36 | $skin = $this->getSkin(); |
37 | 37 | |
38 | - if (! $this->viewFactory->exists($skin)) { |
|
38 | + if (!$this->viewFactory->exists($skin)) { |
|
39 | 39 | throw new SkinNotFoundException($skin); |
40 | 40 | } |
41 | 41 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | public function content(?string $content): self |
33 | 33 | { |
34 | - if (! is_null($content)) { |
|
34 | + if (!is_null($content)) { |
|
35 | 35 | $this->content = $content; |
36 | 36 | } else { |
37 | 37 | unset($this->content); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | public function title(?string $title): self |
44 | 44 | { |
45 | - if (! is_null($title)) { |
|
45 | + if (!is_null($title)) { |
|
46 | 46 | $this->title = $title; |
47 | 47 | } else { |
48 | 48 | unset($this->title); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | public function type(?string $type): self |
55 | 55 | { |
56 | - if (! is_null($type)) { |
|
56 | + if (!is_null($type)) { |
|
57 | 57 | $this->type = $type; |
58 | 58 | } else { |
59 | 59 | unset($this->type); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | public function attribute(string $key, $value = null): self |
130 | 130 | { |
131 | - if (! is_null($value)) { |
|
131 | + if (!is_null($value)) { |
|
132 | 132 | $this->attributes[$key] = $value; |
133 | 133 | } else { |
134 | 134 | unset($this->attributes[$key]); |
@@ -60,18 +60,18 @@ |
||
60 | 60 | |
61 | 61 | $this->app->bind(FlashMessageFactoryContract::class, FlashMessageFactory::class); |
62 | 62 | |
63 | - $this->app->singleton(MessagesStorageManager::class, function (Application $app) { |
|
63 | + $this->app->singleton(MessagesStorageManager::class, function(Application $app) { |
|
64 | 64 | return new MessagesStorageManager($app); |
65 | 65 | }); |
66 | 66 | |
67 | - $this->app->bind(MessagesStorageContract::class, function (Application $app) { |
|
67 | + $this->app->bind(MessagesStorageContract::class, function(Application $app) { |
|
68 | 68 | /** @var MessagesStorageManager $messagesStorageManager */ |
69 | 69 | $messagesStorageManager = $app->make(MessagesStorageManager::class); |
70 | 70 | |
71 | 71 | return $messagesStorageManager->driver(); |
72 | 72 | }); |
73 | 73 | |
74 | - $this->app->singleton('laraflash', function (Application $app) { |
|
74 | + $this->app->singleton('laraflash', function(Application $app) { |
|
75 | 75 | return $app->make(Laraflash::class); |
76 | 76 | }); |
77 | 77 | } |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | use Illuminate\Container\Container; |
4 | 4 | |
5 | -if (! function_exists('laraflash')) { |
|
5 | +if (!function_exists('laraflash')) { |
|
6 | 6 | function laraflash(...$args) |
7 | 7 | { |
8 | 8 | /** @var \Coderello\Laraflash\Laraflash\Laraflash $laraflash */ |