fix: dismiss stale session-timeout flash on auto-login, resolve PHPStan and i18n issues

- Add Flash::dismissByKey() to clear flash messages by key+scope
- Dismiss 'session_timeout' flash after successful remember-me auto-login
  so the message doesn't persist through manual logout
- Suppress PHPStan false positives for dynamically defined MINTY_ALLOW_OUTPUT
- Remove unnecessary ?? [] fallbacks on preg_match_all results in tests
- Add missing i18n key 'No active roles are configured yet.'

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-13 18:56:19 +01:00
parent e1c211069e
commit a27b6a96ff
5 changed files with 38 additions and 8 deletions

View File

@@ -305,7 +305,7 @@ class AuthzUiContractTest extends TestCase
private function extractPageAuthKeys(string $content): array
{
preg_match_all('/\\$pageAuth\\[[\'"]([a-z_]+)[\'"]\\]/', $content, $matches);
$keys = array_values(array_unique($matches[1] ?? []));
$keys = array_values(array_unique($matches[1]));
sort($keys);
return $keys;
}
@@ -317,9 +317,9 @@ class AuthzUiContractTest extends TestCase
{
$keys = [];
preg_match_all('/\\$viewAuth\\[\'page\'\\]\\s*=\\s*\\[(.*?)\\];/s', $content, $blocks);
foreach ($blocks[1] ?? [] as $block) {
foreach ($blocks[1] as $block) {
preg_match_all('/[\'"]([a-z_]+)[\'"]\\s*=>/', $block, $matches);
foreach ($matches[1] ?? [] as $key) {
foreach ($matches[1] as $key) {
$keys[] = $key;
}
}
@@ -348,7 +348,7 @@ class AuthzUiContractTest extends TestCase
);
preg_match_all('/[\'"]([a-z_]+)[\'"]\\s*=>/', (string) ($constantMatch[1] ?? ''), $keyMatches);
$keys = array_values(array_unique($keyMatches[1] ?? []));
$keys = array_values(array_unique($keyMatches[1]));
sort($keys);
return $keys;
}