Skip to content

Commit

Permalink
Upgrade to Symfony 5.0 and Twig 3
Browse files Browse the repository at this point in the history
  • Loading branch information
jordisala1991 committed Jul 29, 2020
1 parent c7370b6 commit cffc86e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 14 deletions.
18 changes: 8 additions & 10 deletions composer.json
Expand Up @@ -22,23 +22,21 @@
}
],
"require": {
"php": "^7.1",
"symfony/config": "^4.4",
"symfony/dependency-injection": "^4.4",
"symfony/http-foundation": "^4.4",
"symfony/http-kernel": "^4.4",
"php": "^7.2",
"symfony/config": "^4.4 || ^5.0",
"symfony/dependency-injection": "^4.4 || ^5.0",
"symfony/http-foundation": "^4.4 || ^5.0",
"symfony/http-kernel": "^4.4 || ^5.0",
"symfony/intl": "^4.4 || ^5.0",
"symfony/templating": "^4.4",
"twig/twig": "^2.9"
"twig/twig": "^2.9 || ^3.0"
},
"conflict": {
"sonata-project/user-bundle": "<2.0 || >=5.0"
"sonata-project/user-bundle": "<3.6"
},
"require-dev": {
"matthiasnoback/symfony-dependency-injection-test": "^4.0",
"sonata-project/user-bundle": "^3.6 || ^4.0",
"symfony/phpunit-bridge": "^5.1",
"symfony/security-core": "^4.4"
"symfony/security-core": "^4.4 || ^5.0"
},
"config": {
"sort-packages": true
Expand Down
31 changes: 27 additions & 4 deletions src/Templating/Helper/BaseHelper.php
Expand Up @@ -14,7 +14,6 @@
namespace Sonata\IntlBundle\Templating\Helper;

use Sonata\IntlBundle\Locale\LocaleDetectorInterface;
use Symfony\Component\Templating\Helper\Helper;

/**
* BaseHelper provides charset conversion.
Expand All @@ -28,8 +27,13 @@
*
* @author Alexander <iam.asm89@gmail.com>
*/
abstract class BaseHelper extends Helper
abstract class BaseHelper
{
/**
* @var string
*/
protected $charset = 'UTF-8';

/**
* @var LocaleDetectorInterface
*/
Expand All @@ -40,11 +44,30 @@ abstract class BaseHelper extends Helper
*/
public function __construct($charset, LocaleDetectorInterface $localeDetector)
{
$this->setCharset($charset);

$this->charset = $charset;
$this->localeDetector = $localeDetector;
}

/**
* Sets the default charset.
*
* @param string $charset The charset
*/
public function setCharset($charset)
{
$this->charset = $charset;
}

/**
* Gets the default charset.
*
* @return string The default charset
*/
public function getCharset()
{
return $this->charset;
}

/**
* Typo in the method name.
*
Expand Down

0 comments on commit cffc86e

Please sign in to comment.