Get all flashes#6
Conversation
| * WILL NOT return values set in the current request via `flash()`. | ||
| * | ||
| * @param mixed $default Default value to return if no flash value exists. | ||
| * @return mixed |
There was a problem hiding this comment.
mixed or array ? or mixed[]?
| * | ||
| * WILL NOT return values set in the current request via `flash()`. | ||
| * | ||
| * @param mixed $default Default value to return if no flash value exists. |
There was a problem hiding this comment.
Can't see any param defined in the function signature.
| public function getFlash(string $key, $default = null); | ||
|
|
||
| /** | ||
| * Retrieve all flash values. |
There was a problem hiding this comment.
I'm not a big fan of copying code into the documentation, then we need to maintain it in two places, and always remember to update it in the docs.... I know it was already here and you've just updated it 👍
| * Retrieve all flash values. | ||
| * | ||
| * Will return all values was set in a previous request, or if `flashNow()` | ||
| * was called in this request with the same `$key`. |
There was a problem hiding this comment.
It is not clear what is the $key.
| * WILL NOT return values set in the current request via `flash()`. | ||
| * | ||
| * @param mixed $default Default value to return if no flash value exists. | ||
| * @return mixed |
There was a problem hiding this comment.
The same comments here as in the docs
| * WILL NOT return values set in the current request via `flash()`. | ||
| * | ||
| * @param mixed $default Default value to return if no flash value exists. | ||
| * @return mixed |
|
|
||
| public function getFlashes() : array | ||
| { | ||
| } |
There was a problem hiding this comment.
This method definition is wrong, must return array, but it's void. Not sure where (if) it is used?
|
Hi @xtreamwayz |
|
Yes, it's possible after a review from @weierophinney :) |
| * | ||
| * WILL NOT return values set in the current request via `flash()`. | ||
| * | ||
| * @return array |
There was a problem hiding this comment.
Can be removed, as we have it already in method signature.
| * | ||
| * WILL NOT return values set in the current request via `flash()`. | ||
| * | ||
| * @return array |
There was a problem hiding this comment.
The same as above, can be removed.
developbranch, and submit against that branch.Sometimes you don't know which messages are added.
FlashMessages::getFlashes()retrieves an array with all messages for the current request.