Skip to content

Commit

Permalink
Merge pull request #128 from gsteel/require-laminas-translator
Browse files Browse the repository at this point in the history
`Laminas\Translator`
  • Loading branch information
gsteel authored Jul 2, 2024
2 parents a567abb + 5bd49f8 commit f09a48c
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 31 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"ext-intl": "*",
"laminas/laminas-servicemanager": "^3.21.0",
"laminas/laminas-stdlib": "^3.0"
"laminas/laminas-stdlib": "^3.0",
"laminas/laminas-translator": "^1.0"
},
"require-dev": {
"laminas/laminas-cache": "^3.12.1",
Expand Down
55 changes: 54 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 20 additions & 1 deletion psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.24.0@462c80e31c34e58cc4f750c656be3927e80e550e">
<files psalm-version="5.25.0@01a8eb06b9e9cc6cfb6a320bf9fb14331919d505">
<file src="src/ConfigProvider.php">
<DeprecatedClass>
<code><![CDATA[Validator\PhoneNumber::class]]></code>
Expand Down Expand Up @@ -332,6 +332,9 @@
</PossiblyNullReference>
</file>
<file src="src/Translator/Translator.php">
<DeprecatedInterface>
<code><![CDATA[Translator]]></code>
</DeprecatedInterface>
<DocblockTypeContradiction>
<code><![CDATA[$message === null]]></code>
<code><![CDATA[$message === null]]></code>
Expand Down Expand Up @@ -444,6 +447,10 @@
</UnsafeInstantiation>
</file>
<file src="src/Translator/TranslatorAwareInterface.php">
<DeprecatedInterface>
<code><![CDATA[TranslatorInterface|null]]></code>
<code><![CDATA[TranslatorInterface|null]]></code>
</DeprecatedInterface>
<PossiblyUnusedMethod>
<code><![CDATA[hasTranslator]]></code>
<code><![CDATA[setTranslatorEnabled]]></code>
Expand All @@ -453,6 +460,13 @@
<code><![CDATA[$this]]></code>
</PossiblyUnusedReturnValue>
</file>
<file src="src/Translator/TranslatorAwareTrait.php">
<DeprecatedInterface>
<code><![CDATA[?TranslatorInterface]]></code>
<code><![CDATA[TranslatorInterface|null]]></code>
<code><![CDATA[TranslatorInterface|null]]></code>
</DeprecatedInterface>
</file>
<file src="src/Translator/TranslatorServiceFactory.php">
<DeprecatedInterface>
<code><![CDATA[TranslatorServiceFactory]]></code>
Expand Down Expand Up @@ -575,6 +589,11 @@
</PossiblyInvalidArgument>
</file>
<file src="src/View/Helper/AbstractTranslatorHelper.php">
<DeprecatedInterface>
<code><![CDATA[Translator|null]]></code>
<code><![CDATA[Translator|null]]></code>
<code><![CDATA[Translator|null]]></code>
</DeprecatedInterface>
<RedundantCastGivenDocblockType>
<code><![CDATA[(bool) $enabled]]></code>
</RedundantCastGivenDocblockType>
Expand Down
34 changes: 6 additions & 28 deletions src/Translator/TranslatorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,14 @@

namespace Laminas\I18n\Translator;

use Laminas\Translator\TranslatorInterface as Translator;

/**
* Translator interface.
*
* @deprecated Since 2.27.0 The translator interface is now in a separate package `laminas/laminas-translator` and this
* interface should be replaced by `Laminas\Translator\TranslatorInterface`
*/
interface TranslatorInterface
interface TranslatorInterface extends Translator
{
/**
* Translate a message.
*
* @param string $message
* @param string $textDomain
* @param string $locale
* @return string
*/
public function translate($message, $textDomain = 'default', $locale = null);

/**
* Translate a plural message.
*
* @param string $singular
* @param string $plural
* @param int $number
* @param string $textDomain
* @param string|null $locale
* @return string
*/
public function translatePlural(
$singular,
$plural,
$number,
$textDomain = 'default',
$locale = null
);
}

0 comments on commit f09a48c

Please sign in to comment.