Skip to content

Conversation

@gsteel
Copy link
Member

@gsteel gsteel commented Jan 18, 2024

Q A
Documentation not-yet
Bugfix no
BC Break yes
New Feature yes
RFC yes
QA yes

This patch breaks BC so it'll need to go into 2.x if acceptable.

The main user-facing change is that flash messages are now list<non-empty-string> instead of mixed.

Previously:

$flash->flash('info', 'whatever');
$flash->flash('info', 'other stuff');
// Next Hop
echo $flash->getFlash('info'); // "other stuff"

Now:

$flash->flash('info', 'whatever');
$flash->flash('info', 'other stuff');
// Next Hop
var_dump($flash->getFlash('info')); // ["whatever", "other stuff"]

Tests have been simplified by replacing mocks with concrete instances. Considering that this library only works with Mezzio\Session, there's little point mocking Session and any BC breaks in Session will be discovered here during lock file maintenance.

Docs will need updating which I'll do in separate patch if this one is acceptable

Repeated calls to `$flasher->flash('error', 'some message')` will aggregate messages under an `error` namespace. Consequently, `$flasher->getFlash('error')` will now yield `list<string>`.

Messages themselves are restricted to `string` instead of `mixed` contributing to 100% type-coverage.

Tests have been simplified by replacing mocks with concrete instances. Considering that this library only works with Mezzio\Session, there's little point mocking Session and any BC breaks in Session will be discovered here during lock file maintenance.

Signed-off-by: George Steel <[email protected]>
@gsteel gsteel added BC Break Enhancement New feature or request labels Jan 18, 2024
@gsteel gsteel added this to the 2.0.0 milestone Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BC Break Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant