Skip to content

Commit

Permalink
Define all possible interfaces sent to our Translator
Browse files Browse the repository at this point in the history
  • Loading branch information
Quetzacoalt91 committed Jun 13, 2024
1 parent d14a0e5 commit 7f548bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions classes/UpgradeTools/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ class Translator implements TranslatorInterface
private $translations = [];

/**
* @var TranslatorInterface|null
* @var \Symfony\Contracts\Translation\TranslatorInterface|\Symfony\Component\Translation\TranslatorInterface|null
*/
private $coreTranslator;

public function __construct(TranslatorInterface $coreTranslator = null)
/**
* @param \Symfony\Contracts\Translation\TranslatorInterface|\Symfony\Component\Translation\TranslatorInterface|null
*/
public function __construct($coreTranslator = null)

Check failure on line 20 in classes/UpgradeTools/Translator.php

View workflow job for this annotation

GitHub Actions / PHPStan (1.7.2.5)

PHPDoc tag @param has invalid value (\Symfony\Contracts\Translation\TranslatorInterface|\Symfony\Component\Translation\TranslatorInterface|null): Unexpected token "\n ", expected variable at offset 124

Check failure on line 20 in classes/UpgradeTools/Translator.php

View workflow job for this annotation

GitHub Actions / PHPStan (1.7.3.4)

PHPDoc tag @param has invalid value (\Symfony\Contracts\Translation\TranslatorInterface|\Symfony\Component\Translation\TranslatorInterface|null): Unexpected token "\n ", expected variable at offset 124

Check failure on line 20 in classes/UpgradeTools/Translator.php

View workflow job for this annotation

GitHub Actions / PHPStan (1.7.5.1)

PHPDoc tag @param has invalid value (\Symfony\Contracts\Translation\TranslatorInterface|\Symfony\Component\Translation\TranslatorInterface|null): Unexpected token "\n ", expected variable at offset 124
{
$this->coreTranslator = $coreTranslator;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function ps_1730_add_quick_access_evaluation_catalog()
Db::getInstance()->execute('INSERT INTO `' . _DB_PREFIX_ . 'quick_access_lang` SET
`id_quick_access` = ' . $idQuickAccess . ',
`id_lang` = ' . (int) $language['id_lang'] . ',
`name` = "' . pSQL($translator->trans('Catalog evaluation', 'Admin.Navigation.Header')) . '" ');
`name` = "' . pSQL($translator->trans('Catalog evaluation', [], 'Admin.Navigation.Header')) . '" ');
}
}
}

0 comments on commit 7f548bc

Please sign in to comment.