-
Notifications
You must be signed in to change notification settings - Fork 183
Added an optional flashmessage listener #183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
9e02547
f21d3ea
ef1ee68
8e1d37b
31de539
97fd7dd
fb105f3
ac283df
f884e39
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,7 +66,7 @@ public function load(array $configs, ContainerBuilder $container) | |
| $container->getDefinition('fos_message.recipients_data_transformer') | ||
| ->replaceArgument(0, new Reference($config['user_transformer'])); | ||
|
|
||
| if($config['flash_messages']['show']) | ||
| if($config['flash_messages']['enabled']) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing space between if ()
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This occurs in a few places |
||
| { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this curly brace should be on the previous line |
||
| $loader->load('flash.xml'); | ||
| $container->setAlias('fos_message.flash_listener', $config['flash_messages']['service']); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the alias is useless as we will never reference it (it is an event listener, not a dependency for other services). The event dispatcher will use the service id itself when reading tags
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If @merk agrees I'll undo those changes. I also don't think it's really something users will want to overwrite. Then again there are always strange use cases... |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,8 +75,8 @@ public function addSuccessFlash(Event $event) | |
| { | ||
| $eventName = $event->getname(); | ||
|
|
||
| if (!isset(self::$successMessages[$eventName])) { | ||
| throw new \InvalidArgumentException('This event does not correspond to a known flash message'); | ||
| if (!isset(self::$successMessages[$eventName])) { | ||
| throw new \InvalidArgumentException('This event does not correspond to a known flash message'); | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Spacing |
||
|
|
||
| $this->session->getFlashBag()->add($this->key, $this->trans(self::$successMessages[$eventName])); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cannotBeEmptylooks weird as the code allows using an empty key