Skip to content

Commit

Permalink
compatibility between 4.4 and 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleš committed Nov 21, 2019
1 parent 1b44320 commit 79c4f3e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
10 changes: 8 additions & 2 deletions src/DebuggerTranslator.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,17 @@ public function setTracyPanel(?Tracy\Panel $tracyPanel): self
}

/**
* {@inheritdoc}
* @param string|null $id
* @param mixed[] $parameters
* @param string|null $domain
* @param string|null $locale
* @return string
* @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint
* @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint
*/
public function trans($id, array $parameters = [], $domain = null, $locale = null)
{
if ($this->tracyPanel !== null) {
if ($id !== null && $this->tracyPanel !== null) {
if ($domain === null) {
$domain = 'messages';
}
Expand Down
10 changes: 8 additions & 2 deletions src/LoggerTranslator.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,17 @@ public function setPsrLogger(?Psr\Log\LoggerInterface $psrLogger): self
}

/**
* {@inheritdoc}
* @param string|null $id
* @param mixed[] $parameters
* @param string|null $domain
* @param string|null $locale
* @return string
* @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint
* @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint
*/
public function trans($id, array $parameters = [], $domain = null, $locale = null)
{
if ($this->psrLogger !== null) {
if ($id !== null && $this->psrLogger !== null) {
if ($domain === null) {
$domain = 'messages';
}
Expand Down
7 changes: 6 additions & 1 deletion src/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,12 @@ public function getAvailableLocales(): array
}

/**
* {@inheritdoc}
* @param string $format
* @param mixed $resource
* @param string $locale
* @param string $domain
* @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint
* @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint
*/
public function addResource($format, $resource, $locale, $domain = null)
{
Expand Down

0 comments on commit 79c4f3e

Please sign in to comment.