@@ -84,7 +84,7 @@ |
||
84 | 84 | */ |
85 | 85 | public static function register(Nette\Configurator $config, $extensionName = 'flashMessages') |
86 | 86 | { |
87 | - $config->onCompile[] = function (Nette\Configurator $config, Nette\DI\Compiler $compiler) use ($extensionName) { |
|
87 | + $config->onCompile[] = function(Nette\Configurator $config, Nette\DI\Compiler $compiler) use ($extensionName) { |
|
88 | 88 | $compiler->addExtension($extensionName, new FlashMessagesExtension()); |
89 | 89 | }; |
90 | 90 | } |
@@ -23,10 +23,10 @@ discard block |
||
23 | 23 | |
24 | 24 | class Message extends Nette\Object implements IMessage |
25 | 25 | { |
26 | - const LEVEL_INFO = 'info'; |
|
26 | + const LEVEL_INFO = 'info'; |
|
27 | 27 | const LEVEL_SUCCESS = 'success'; |
28 | 28 | const LEVEL_WARNING = 'warning'; |
29 | - const LEVEL_ERROR = 'error'; |
|
29 | + const LEVEL_ERROR = 'error'; |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * @var string |
@@ -69,8 +69,8 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function __construct(Localization\ITranslator $translator = NULL, Adapters\IPhraseAdapter $phraseAdapter) |
71 | 71 | { |
72 | - $this->translator = $translator; |
|
73 | - $this->phraseAdapter = $phraseAdapter; |
|
72 | + $this->translator = $translator; |
|
73 | + $this->phraseAdapter = $phraseAdapter; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -42,7 +42,7 @@ |
||
42 | 42 | { |
43 | 43 | $messages = $this->sessionStorage->get(FlashMessages\SessionStorage::KEY_MESSAGES, []); |
44 | 44 | |
45 | - foreach($messages as $key => $message) { |
|
45 | + foreach ($messages as $key => $message) { |
|
46 | 46 | if ($message->isDisplayed()) { |
47 | 47 | unset($messages[$key]); |
48 | 48 | } |
@@ -22,8 +22,8 @@ |
||
22 | 22 | /** |
23 | 23 | * Define session keys |
24 | 24 | */ |
25 | - const KEY_MESSAGES = 'messages'; |
|
26 | - const KEY_IMPORTANT = 'important'; |
|
25 | + const KEY_MESSAGES = 'messages'; |
|
26 | + const KEY_IMPORTANT = 'important'; |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * @var Http\SessionSection |
@@ -150,9 +150,9 @@ discard block |
||
150 | 150 | $messages = $this->sessionStorage->get(FlashMessages\SessionStorage::KEY_MESSAGES); |
151 | 151 | |
152 | 152 | // Assign vars to template |
153 | - $this->template->flashes = $messages ? $messages : []; |
|
154 | - $this->template->useTitle = $this->useTitle; |
|
155 | - $this->template->useOverlay = $this->useOverlay; |
|
153 | + $this->template->flashes = $messages ? $messages : []; |
|
154 | + $this->template->useTitle = $this->useTitle; |
|
155 | + $this->template->useOverlay = $this->useOverlay; |
|
156 | 156 | |
157 | 157 | // Check if translator is available |
158 | 158 | if ($this->getTranslator() instanceof Localization\ITranslator) { |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | // If template was not defined before... |
163 | 163 | if ($this->template->getFile() === NULL) { |
164 | 164 | // ...try to get base component template file |
165 | - $templateFile = !empty($this->templateFile) ? $this->templateFile : __DIR__ . DIRECTORY_SEPARATOR .'template'. DIRECTORY_SEPARATOR .'default'. DIRECTORY_SEPARATOR .'default.latte'; |
|
165 | + $templateFile = !empty($this->templateFile) ? $this->templateFile : __DIR__ . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . 'default' . DIRECTORY_SEPARATOR . 'default.latte'; |
|
166 | 166 | $this->template->setFile($templateFile); |
167 | 167 | } |
168 | 168 | |
@@ -191,12 +191,12 @@ discard block |
||
191 | 191 | $template = basename($templateFile, '.latte'); |
192 | 192 | |
193 | 193 | // ...check if extension template is used |
194 | - if (is_file(__DIR__ . DIRECTORY_SEPARATOR .'template'. DIRECTORY_SEPARATOR . $template . DIRECTORY_SEPARATOR .'default.latte')) { |
|
195 | - $templateFile = __DIR__ . DIRECTORY_SEPARATOR .'template'. DIRECTORY_SEPARATOR . $template . DIRECTORY_SEPARATOR .'default.latte'; |
|
194 | + if (is_file(__DIR__ . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . $template . DIRECTORY_SEPARATOR . 'default.latte')) { |
|
195 | + $templateFile = __DIR__ . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . $template . DIRECTORY_SEPARATOR . 'default.latte'; |
|
196 | 196 | |
197 | 197 | } else { |
198 | 198 | // ...if not throw exception |
199 | - throw new Exceptions\FileNotFoundException('Template file "'. $templateFile .'" was not found.'); |
|
199 | + throw new Exceptions\FileNotFoundException('Template file "' . $templateFile . '" was not found.'); |
|
200 | 200 | } |
201 | 201 | } |
202 | 202 |
@@ -41,9 +41,9 @@ |
||
41 | 41 | */ |
42 | 42 | function __construct($message, $count, $parameters = []) |
43 | 43 | { |
44 | - $this->parameters = $parameters; |
|
45 | - $this->count = $count; |
|
46 | - $this->message = $message; |
|
44 | + $this->parameters = $parameters; |
|
45 | + $this->count = $count; |
|
46 | + $this->message = $message; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |