Skip to content

Commit

Permalink
Require twig ^1.35 but now ^2.4 instead of ^2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
David Sanchez authored and emulienfou committed May 18, 2019
1 parent 974cf2d commit 5e08de7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"symfony/http-foundation": "^2.8 || ^3.2 || ^4.0",
"symfony/http-kernel": "^2.8 || ^3.2 || ^4.0",
"symfony/options-resolver": "^2.8 || ^3.2 || ^4.0",
"twig/twig": "^1.35 || ^2.0"
"twig/twig": "^1.35 || ^2.4"
},
"conflict": {
"sonata-project/block-bundle": "<3.11"
Expand Down
18 changes: 10 additions & 8 deletions src/Twig/Extension/SeoExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
namespace Sonata\SeoBundle\Twig\Extension;

use Sonata\SeoBundle\Seo\SeoPageInterface;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;

class SeoExtension extends \Twig_Extension
class SeoExtension extends AbstractExtension
{
/**
* @var SeoPageInterface
Expand Down Expand Up @@ -43,13 +45,13 @@ public function __construct(SeoPageInterface $page, $encoding)
public function getFunctions()
{
return [
new \Twig_SimpleFunction('sonata_seo_title', [$this, 'getTitle'], ['is_safe' => ['html']]),
new \Twig_SimpleFunction('sonata_seo_metadatas', [$this, 'getMetadatas'], ['is_safe' => ['html']]),
new \Twig_SimpleFunction('sonata_seo_html_attributes', [$this, 'getHtmlAttributes'], ['is_safe' => ['html']]),
new \Twig_SimpleFunction('sonata_seo_head_attributes', [$this, 'getHeadAttributes'], ['is_safe' => ['html']]),
new \Twig_SimpleFunction('sonata_seo_link_canonical', [$this, 'getLinkCanonical'], ['is_safe' => ['html']]),
new \Twig_SimpleFunction('sonata_seo_lang_alternates', [$this, 'getLangAlternates'], ['is_safe' => ['html']]),
new \Twig_SimpleFunction('sonata_seo_oembed_links', [$this, 'getOembedLinks'], ['is_safe' => ['html']]),
new TwigFunction('sonata_seo_title', [$this, 'getTitle'], ['is_safe' => ['html']]),
new TwigFunction('sonata_seo_metadatas', [$this, 'getMetadatas'], ['is_safe' => ['html']]),
new TwigFunction('sonata_seo_html_attributes', [$this, 'getHtmlAttributes'], ['is_safe' => ['html']]),
new TwigFunction('sonata_seo_head_attributes', [$this, 'getHeadAttributes'], ['is_safe' => ['html']]),
new TwigFunction('sonata_seo_link_canonical', [$this, 'getLinkCanonical'], ['is_safe' => ['html']]),
new TwigFunction('sonata_seo_lang_alternates', [$this, 'getLangAlternates'], ['is_safe' => ['html']]),
new TwigFunction('sonata_seo_oembed_links', [$this, 'getOembedLinks'], ['is_safe' => ['html']]),
];
}

Expand Down

0 comments on commit 5e08de7

Please sign in to comment.