-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hotfix release 2.3.2
- Loading branch information
Showing
2 changed files
with
24 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
/** | ||
* This file is part of contao-community-alliance/translator. | ||
* | ||
* (c) 2013-2021 Contao Community Alliance. | ||
* (c) 2013-2023 Contao Community Alliance. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
@@ -14,7 +14,8 @@ | |
* @author Christian Schiffler <[email protected]> | ||
* @author Tristan Lins <[email protected]> | ||
* @author Sven Baumann <[email protected]> | ||
* @copyright 2013-2021 Contao Community Alliance. | ||
* @author Ingolf Steinhardt <[email protected]> | ||
* @copyright 2013-2023 Contao Community Alliance. | ||
* @license https://github.com/contao-community-alliance/translator/blob/master/LICENSE LGPL-3.0 | ||
* @filesource | ||
*/ | ||
|
@@ -53,15 +54,27 @@ public function __construct(EventDispatcherInterface $eventDispatcher) | |
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
* Retrieve the value. | ||
* | ||
* @param mixed $string The string to translate. | ||
* @param string|null $domain The domain to use. | ||
* @param string|null $locale The locale (otherwise the current default locale will get used). | ||
* | ||
* @return array<string, string>|string | ||
* @SuppressWarnings(PHPMD.Superglobals) | ||
* @SuppressWarnings(PHPMD.CamelCaseVariableName) | ||
* | ||
* @psalm-suppress MixedInferredReturnType | ||
*/ | ||
protected function getValue($string, $domain, $locale) | ||
{ | ||
if (false === \is_string($string)) { | ||
// @codingStandardsIgnoreStart | ||
@\trigger_error('Only string allowed to translate!', E_USER_DEPRECATED); | ||
// @codingStandardsIgnoreEnd | ||
return ''; | ||
} | ||
|
||
if (null === $domain) { | ||
$domain = 'default'; | ||
} | ||
|