Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Get all flashes#6

Merged
geerteltink merged 3 commits into
zendframework:release-1.0.0from
geerteltink:feature/get-all-flashes
Feb 24, 2018
Merged

Get all flashes#6
geerteltink merged 3 commits into
zendframework:release-1.0.0from
geerteltink:feature/get-all-flashes

Conversation

@geerteltink

@geerteltink geerteltink commented Jan 27, 2018

Copy link
Copy Markdown
Member
  • Are you creating a new feature?
    • Why is the new feature needed? What purpose does it serve?
    • Base your feature on the develop branch, and submit against that branch.
    • Add only one feature per pull request; split multiple features over multiple pull requests
    • Add tests for the new feature.
    • Add documentation for the new feature.

Sometimes you don't know which messages are added. FlashMessages::getFlashes() retrieves an array with all messages for the current request.

Comment thread docs/book/messages.md Outdated
* 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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mixed or array ? or mixed[]?

Comment thread docs/book/messages.md Outdated
*
* WILL NOT return values set in the current request via `flash()`.
*
* @param mixed $default Default value to return if no flash value exists.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't see any param defined in the function signature.

Comment thread docs/book/messages.md
public function getFlash(string $key, $default = null);

/**
* Retrieve all flash values.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 👍

Comment thread docs/book/messages.md Outdated
* 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`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not clear what is the $key.

Comment thread src/FlashMessages.php Outdated
* 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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same comments here as in the docs

Comment thread src/FlashMessagesInterface.php Outdated
* 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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here as well.


public function getFlashes() : array
{
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method definition is wrong, must return array, but it's void. Not sure where (if) it is used?

@vitorloureiro

Copy link
Copy Markdown

Hi @xtreamwayz
It is possible to merge this? i think this is essential for the flash messages middleware.

@geerteltink

Copy link
Copy Markdown
Member Author

Yes, it's possible after a review from @weierophinney :)

Comment thread src/FlashMessages.php
*
* WILL NOT return values set in the current request via `flash()`.
*
* @return array

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed, as we have it already in method signature.

*
* WILL NOT return values set in the current request via `flash()`.
*
* @return array

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same as above, can be removed.

@geerteltink geerteltink merged commit 9b3757c into zendframework:release-1.0.0 Feb 24, 2018
geerteltink added a commit that referenced this pull request Feb 24, 2018
geerteltink added a commit that referenced this pull request Feb 24, 2018
geerteltink added a commit that referenced this pull request Feb 24, 2018
@geerteltink geerteltink deleted the feature/get-all-flashes branch February 24, 2018 07:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants