Skip to content

Commit

Permalink
removed parameter type of AbstractChoices methods to fix exception
Browse files Browse the repository at this point in the history
  • Loading branch information
koertho committed Dec 21, 2022
1 parent 478f663 commit eb19232
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,9 @@

All notable changes to this project will be documented in this file.

## [2.223.2] - 2022-12-21
- Fixed: Exception if Choice is used as options callback

## [2.223.1] - 2022-12-20
- Fixed: Choices cache not taking locale into account
- Fixed: used deprecated ServiceSubscriber if available in AbstractServiceSubscriber
Expand Down
6 changes: 3 additions & 3 deletions src/Choice/AbstractChoice.php
Expand Up @@ -70,7 +70,7 @@ public function setContext($context)
return $this;
}

public function getChoices(?array $context = [])
public function getChoices($context = [])
{
if (!$context) {
$context = [];
Expand All @@ -83,13 +83,13 @@ public function getChoices(?array $context = [])
return $choices;
}

public function getCachedChoices(?array $context = [])
public function getCachedChoices($context = [])
{
if (null === $context) {
$context = [];
}

if (!isset($context['locale']) && ($request = System::getContainer()->get('request_stack')->getCurrentRequest())) {
if (\is_array($context) && !isset($context['locale']) && ($request = System::getContainer()->get('request_stack')->getCurrentRequest())) {
$context['locale'] = $request->getLocale();
}

Expand Down

0 comments on commit eb19232

Please sign in to comment.