@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -if (!session_id()) @session_start(); |
|
2 | +if ( ! session_id()) @session_start(); |
|
3 | 3 | require_once('../../vendor/autoload.php'); |
4 | 4 | |
5 | 5 | use Tamtamchik\SimpleFlash\Exceptions\FlashTemplateNotFoundException; |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if (!session_id()) @session_start(); |
|
2 | +if (!session_id()) { |
|
3 | + @session_start(); |
|
4 | +} |
|
3 | 5 | require_once('../../vendor/autoload.php'); |
4 | 6 | |
5 | 7 | use Tamtamchik\SimpleFlash\Exceptions\FlashTemplateNotFoundException; |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | use Tamtamchik\SimpleFlash\Exceptions\FlashTemplateNotFoundException; |
4 | 4 | |
5 | -if (!session_id()) @session_start(); |
|
5 | +if ( ! session_id()) @session_start(); |
|
6 | 6 | require_once('../../vendor/autoload.php'); |
7 | 7 | |
8 | 8 | try { |
@@ -2,7 +2,9 @@ |
||
2 | 2 | |
3 | 3 | use Tamtamchik\SimpleFlash\Exceptions\FlashTemplateNotFoundException; |
4 | 4 | |
5 | -if (!session_id()) @session_start(); |
|
5 | +if (!session_id()) { |
|
6 | + @session_start(); |
|
7 | +} |
|
6 | 8 | require_once('../../vendor/autoload.php'); |
7 | 9 | |
8 | 10 | try { |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | { |
33 | 33 | $this->template = $template; |
34 | 34 | |
35 | - if (!array_key_exists($this->key, $_SESSION)) { |
|
35 | + if ( ! array_key_exists($this->key, $_SESSION)) { |
|
36 | 36 | $_SESSION[$this->key] = []; |
37 | 37 | } |
38 | 38 | } |
@@ -70,11 +70,11 @@ discard block |
||
70 | 70 | { |
71 | 71 | $type = strip_tags($type); |
72 | 72 | |
73 | - if (empty($message) || !in_array($type, $this->types)) { |
|
73 | + if (empty($message) || ! in_array($type, $this->types)) { |
|
74 | 74 | return $this; |
75 | 75 | } |
76 | 76 | |
77 | - if (!array_key_exists($type, $_SESSION[$this->key])) { |
|
77 | + if ( ! array_key_exists($type, $_SESSION[$this->key])) { |
|
78 | 78 | $_SESSION[$this->key][$type] = []; |
79 | 79 | } |
80 | 80 | |
@@ -98,17 +98,17 @@ discard block |
||
98 | 98 | $result = ''; |
99 | 99 | |
100 | 100 | if ( |
101 | - !array_key_exists($this->key, $_SESSION) || |
|
102 | - (!is_null($type) && !array_key_exists($type, $_SESSION[$this->key])) |
|
101 | + ! array_key_exists($this->key, $_SESSION) || |
|
102 | + ( ! is_null($type) && ! array_key_exists($type, $_SESSION[$this->key])) |
|
103 | 103 | ) { |
104 | 104 | return $result; |
105 | 105 | } |
106 | 106 | |
107 | - if (!is_null($template)) { |
|
107 | + if ( ! is_null($template)) { |
|
108 | 108 | $this->setTemplate(TemplateFactory::create($template)); |
109 | 109 | } |
110 | 110 | |
111 | - if (!is_null($type) && !in_array($type, $this->types)) { |
|
111 | + if ( ! is_null($type) && ! in_array($type, $this->types)) { |
|
112 | 112 | return $result; |
113 | 113 | } |
114 | 114 | |
@@ -134,12 +134,12 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public function hasMessages(string $type = null): bool |
136 | 136 | { |
137 | - if (!is_null($type)) { |
|
138 | - return !empty($_SESSION[$this->key][$type]); |
|
137 | + if ( ! is_null($type)) { |
|
138 | + return ! empty($_SESSION[$this->key][$type]); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | foreach ($this->types as $type) { |
142 | - if (!empty($_SESSION[$this->key][$type])) { |
|
142 | + if ( ! empty($_SESSION[$this->key][$type])) { |
|
143 | 143 | return true; |
144 | 144 | } |
145 | 145 | } |