Skip to content

Commit

Permalink
Merge branch '5.2' into 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed Sep 17, 2024
2 parents bf85374 + 3fed530 commit 394677f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- [Bakery] Added the server option to `assets:webpack` to run HMR server (`npm run webpack:server`) plus use new npm command syntax.
- [Bakery] `AbstractAggregateCommandEvent` construction is now optional. Added `addCommands` and `prependCommands`. All setters methods return `$this`.

## [5.1.2](https://github.com/userfrosting/sprinkle-core/compare/5.1.1...5.1.2)
- Fix [#1264](https://github.com/userfrosting/UserFrosting/issues/1264) - The browser locale is not applied automatically

## [5.1.1](https://github.com/userfrosting/sprinkle-core/compare/5.1.0...5.1.1)
- Fix issue with sprunje using multiple listable fetched from database ([Chat Reference](https://chat.userfrosting.com/channel/support?msg=sgMq8sbAjsCN2ZGXj))

Expand Down
6 changes: 3 additions & 3 deletions app/src/Middlewares/LocaleMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use UserFrosting\Sprinkle\Core\I18n\SiteLocale;
use UserFrosting\Sprinkle\Core\I18n\SiteLocaleInterface;

class LocaleMiddleware implements MiddlewareInterface
{
/**
* @param SiteLocale $siteLocale Inject SiteLocale service
* @param SiteLocaleInterface $siteLocale Inject SiteLocale service
*/
public function __construct(
protected SiteLocale $siteLocale,
protected SiteLocaleInterface $siteLocale,
) {
}

Expand Down
3 changes: 2 additions & 1 deletion app/tests/Integration/I18n/SiteLocaleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use UserFrosting\I18n\Locale;
use UserFrosting\I18n\Translator;
use UserFrosting\Sprinkle\Core\I18n\SiteLocale;
use UserFrosting\Sprinkle\Core\I18n\SiteLocaleInterface;
use UserFrosting\Sprinkle\Core\Tests\CoreTestCase as TestCase;
use UserFrosting\UniformResourceLocator\ResourceLocator;
use UserFrosting\UniformResourceLocator\ResourceStream;
Expand Down Expand Up @@ -341,7 +342,7 @@ public function testMiddlewareWithSimulatedBrowserLocale(): void

class ControllerStub
{
public function __invoke(Response $response, SiteLocale $siteLocale): Response
public function __invoke(Response $response, SiteLocaleInterface $siteLocale): Response
{
$response->getBody()->write($siteLocale->getLocaleIdentifier());

Expand Down

0 comments on commit 394677f

Please sign in to comment.