@@ -49,7 +49,7 @@ |
||
| 49 | 49 | $template = TemplateFactory::create(); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - if (!$assigned || !isset(self::$engine)) { |
|
| 52 | + if ( ! $assigned || ! isset(self::$engine)) { |
|
| 53 | 53 | self::$engine = new Engine($template); |
| 54 | 54 | } |
| 55 | 55 | } |
@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | use Tamtamchik\SimpleFlash\TemplateInterface; |
| 6 | 6 | use Tamtamchik\SimpleFlash\Exceptions\FlashTemplateNotFoundException; |
| 7 | 7 | |
| 8 | -if (!function_exists('flash')) { |
|
| 8 | +if ( ! function_exists('flash')) { |
|
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * Wrapper for flash object to be used as global function. |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | { |
| 22 | 22 | $flash = new Flash($template); |
| 23 | 23 | |
| 24 | - if (!empty($message)) { |
|
| 24 | + if ( ! empty($message)) { |
|
| 25 | 25 | return $flash->message($message, $type); |
| 26 | 26 | } |
| 27 | 27 | |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public function wrapMessage(string $message): string |
| 30 | 30 | { |
| 31 | - return $this->getPrefix() . $message . $this->getPostfix(); |
|
| 31 | + return $this->getPrefix().$message.$this->getPostfix(); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | public static function create(string $name = Templates::BASE): TemplateInterface |
| 21 | 21 | { |
| 22 | - $class = __NAMESPACE__ . '\\Templates\\' . ucwords($name) . 'Template'; |
|
| 22 | + $class = __NAMESPACE__.'\\Templates\\'.ucwords($name).'Template'; |
|
| 23 | 23 | |
| 24 | 24 | if (class_exists($class)) { |
| 25 | 25 | return new $class(); |
@@ -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 | } |