-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Symfony ^4.0|^5.0 + fix various deprecations + fix tr…
…avis CI (#271) - Fix Travis tests - Minimum supported version: Symfony 3.4 version (LTS) - Added support for the latest versions of Symfony - Drop support for older versions of PHP (following the minimum supported version of most Symfony packages - 7.1)
- Loading branch information
Showing
13 changed files
with
71 additions
and
63 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
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,14 +3,16 @@ | |
namespace Bazinga\Bundle\JsTranslationBundle\Controller; | ||
|
||
use Bazinga\Bundle\JsTranslationBundle\Finder\TranslationFinder; | ||
use Symfony\Component\Translation\TranslatorInterface; | ||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; | ||
use Symfony\Component\Translation\TranslatorInterface as LegacyTranslatorInterface; | ||
use Symfony\Contracts\Translation\TranslatorInterface; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\Config\ConfigCache; | ||
use Symfony\Component\Config\Resource\FileResource; | ||
use Symfony\Component\Filesystem\Exception\IOException; | ||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; | ||
use Twig_Environment; | ||
use Twig\Environment; | ||
use Twig\Loader\LoaderInterface; | ||
|
||
/** | ||
* @author William DURAND <[email protected]> | ||
|
@@ -23,7 +25,7 @@ class Controller | |
private $translator; | ||
|
||
/** | ||
* @var Twig_Environment | ||
* @var Environment | ||
*/ | ||
private $twig; | ||
|
||
|
@@ -62,25 +64,30 @@ class Controller | |
private $httpCacheTime; | ||
|
||
/** | ||
* @param TranslatorInterface $translator The translator. | ||
* @param Twig_Environment $twig The twig environment. | ||
* @param TranslationFinder $translationFinder The translation finder. | ||
* @param string $cacheDir | ||
* @param boolean $debug | ||
* @param string $localeFallback | ||
* @param string $defaultDomain | ||
* @param int $httpCacheTime | ||
* @param TranslatorInterface $translator The translator. | ||
* @param Environment $twig The twig environment. | ||
* @param TranslationFinder $translationFinder The translation finder. | ||
* @param string $cacheDir | ||
* @param boolean $debug | ||
* @param string $localeFallback | ||
* @param string $defaultDomain | ||
* @param int $httpCacheTime | ||
* @throws \InvalidArgumentException | ||
*/ | ||
public function __construct( | ||
TranslatorInterface $translator, | ||
Twig_Environment $twig, | ||
$translator, | ||
Environment $twig, | ||
TranslationFinder $translationFinder, | ||
$cacheDir, | ||
$debug = false, | ||
$localeFallback = '', | ||
$defaultDomain = '', | ||
$httpCacheTime = 86400 | ||
) { | ||
if (!$translator instanceof TranslatorInterface && !$translator instanceof LegacyTranslatorInterface) { | ||
throw new \InvalidArgumentException(sprintf('Providing an instance of "%s" as translator is not supported.', get_class($translator))); | ||
} | ||
|
||
$this->translator = $translator; | ||
$this->twig = $twig; | ||
$this->translationFinder = $translationFinder; | ||
|
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
use Bazinga\Bundle\JsTranslationBundle\Finder\TranslationFinder; | ||
use Symfony\Component\Config\Loader\LoaderInterface; | ||
use Symfony\Component\Filesystem\Filesystem; | ||
use Twig_Environment; | ||
use Twig\Environment; | ||
|
||
/** | ||
* @author Adrien Russo <[email protected]> | ||
|
@@ -16,7 +16,7 @@ class TranslationDumper | |
const DEFAULT_TRANSLATION_PATTERN = '/translations/{domain}.{_format}'; | ||
|
||
/** | ||
* @var \Twig_Environment | ||
* @var Environment | ||
*/ | ||
private $twig; | ||
|
||
|
@@ -56,14 +56,14 @@ class TranslationDumper | |
private $defaultDomain; | ||
|
||
/** | ||
* @param Twig_Environment $twig The twig environment. | ||
* @param TranslationFinder $finder The translation finder. | ||
* @param FileSystem $filesystem The file system. | ||
* @param string $localeFallback | ||
* @param string $defaultDomain | ||
* @param Environment $twig The twig environment. | ||
* @param TranslationFinder $finder The translation finder. | ||
* @param FileSystem $filesystem The file system. | ||
* @param string $localeFallback | ||
* @param string $defaultDomain | ||
*/ | ||
public function __construct( | ||
Twig_Environment $twig, | ||
Environment $twig, | ||
TranslationFinder $finder, | ||
Filesystem $filesystem, | ||
$localeFallback = '', | ||
|
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 |
---|---|---|
|
@@ -2,8 +2,6 @@ | |
|
||
namespace Bazinga\Bundle\JsTranslationBundle\Finder; | ||
|
||
use Symfony\Component\Finder\Finder; | ||
|
||
/** | ||
* @author William DURAND <[email protected]> | ||
* @author Markus Poerschke <[email protected]> | ||
|
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
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
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# for symfony version >= 4.4. | ||
imports: | ||
- { resource: base_config.yml } | ||
|
||
framework: | ||
router: | ||
utf8: true | ||
|
||
twig: | ||
exception_controller: null |
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 was deleted.
Oops, something went wrong.
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