Skip to content

Commit 46afa5c

Browse files
committed
update twig extenion
1 parent 6fa07ff commit 46afa5c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Twig/TmdbExtension.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33

44
use Tmdb\Client;
55
use Tmdb\Helper\ImageHelper;
6-
use Tmdb\Model\Image;
76
use Tmdb\Repository\ConfigurationRepository;
7+
use Twig\Extension\AbstractExtension;
8+
use Twig\TwigFilter;
89

9-
class TmdbExtension extends \Twig_Extension
10+
class TmdbExtension extends AbstractExtension
1011
{
1112
/**
1213
* @var ImageHelper|null
@@ -26,8 +27,8 @@ public function __construct(Client $client)
2627
public function getFilters()
2728
{
2829
return array(
29-
new \Twig_SimpleFilter('tmdb_image_html', array($this, 'getHtml')),
30-
new \Twig_SimpleFilter('tmdb_image_url', array($this, 'getUrl')),
30+
new TwigFilter('tmdb_image_html', array($this, 'getHtml')),
31+
new TwigFilter('tmdb_image_url', array($this, 'getUrl')),
3132
);
3233
}
3334

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"symfony/http-kernel": "^4.3.7 || ^5.0",
2121
"symfony/yaml": "^4.3.7 || ^5.0",
2222
"php-tmdb/api": "^3.0",
23-
"twig/twig": "^1.11|^2.0"
23+
"twig/twig": "^2.0|^3.0"
2424
},
2525
"require-dev": {
2626
"phpunit/phpunit": ">=5.7",

0 commit comments

Comments
 (0)