Commit a6357b5f authored by Guillaume Perréal's avatar Guillaume Perréal Committed by Guillaume Perréal
Browse files

Correction de deprecations.

parent 22b00893
......@@ -22,11 +22,14 @@
namespace Irstea\NgModelGeneratorBundle\Twig;
use Irstea\NgModelGeneratorBundle\TypescriptHelper;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
use Twig\TwigFunction;
/**
* Class GeneratorExtension.
*/
class GeneratorExtension extends \Twig_Extension
final class GeneratorExtension extends AbstractExtension
{
/** @noinspection PhpMissingParentCallCommonInspection */
......@@ -36,9 +39,9 @@ class GeneratorExtension extends \Twig_Extension
public function getFilters(): array
{
return [
new \Twig_Filter('quoteString', [TypescriptHelper::class, 'quoteString']),
new \Twig_Filter('objectKey', [TypescriptHelper::class, 'objectLiteralKey']),
new \Twig_Filter('indent', [TypescriptHelper::class, 'indent']),
new TwigFilter('quoteString', [TypescriptHelper::class, 'quoteString']),
new TwigFilter('objectKey', [TypescriptHelper::class, 'objectLiteralKey']),
new TwigFilter('indent', [TypescriptHelper::class, 'indent']),
];
}
......@@ -50,8 +53,8 @@ class GeneratorExtension extends \Twig_Extension
public function getFunctions(): array
{
return [
new \Twig_Function('propertyHaser', [TypescriptHelper::class, 'propertyTestor'], ['is_safe' => true]),
new \Twig_Function(
new TwigFunction('propertyHaser', [TypescriptHelper::class, 'propertyTestor'], ['is_safe' => true]),
new TwigFunction(
'propertyAccessor',
[TypescriptHelper::class, 'propertyAccessor'],
['is_safe' => true]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment