Skip to content

Commit

Permalink
Merge tag '2.3.2'
Browse files Browse the repository at this point in the history
Hotfix release 2.3.2
  • Loading branch information
baumannsven committed Jan 14, 2023
2 parents fcfbf24 + fd53d55 commit ed16ed8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/diagnostics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,29 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- php: 7.4
output: '-o github-action -o default'
phpcq_install: 'install'
- php: 8.0
output: '-o default'
phpcq_install: 'update'
php: ['7.4', '8.0', '8.1', '8.2']
phpcq_install: ['update']
output: ['-o github-action -o default']

steps:
- name: Pull source
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: Cache composer cache directory
uses: actions/cache@v1
uses: actions/cache@v3
env:
cache-name: composer-cache-dir
with:
path: ~/.cache/composer
key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}

- name: Cache vendor directory
uses: actions/cache@v1
uses: actions/cache@v3
env:
cache-name: vendor
with:
Expand All @@ -51,7 +47,7 @@ jobs:
${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}-
- name: Cache phpcq directory
uses: actions/cache@v1
uses: actions/cache@v3
env:
cache-name: phpcq
with:
Expand All @@ -70,7 +66,7 @@ jobs:
run: ./vendor/bin/phpcq run -v ${{ matrix.output }}

- name: Upload build directory to artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: ${{ success() }} || ${{ failure() }}
with:
name: phpcq-builds-php-${{ matrix.php }}
Expand Down
19 changes: 16 additions & 3 deletions src/Contao/LangArrayTranslator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
*/
Expand Down Expand Up @@ -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';
}
Expand Down

0 comments on commit ed16ed8

Please sign in to comment.