Skip to content

Commit

Permalink
Merge pull request #300 from W0rma/fix-twig-deprecations
Browse files Browse the repository at this point in the history
Fix twig deprecations
  • Loading branch information
goetas authored Nov 29, 2019
2 parents d37bd93 + e425060 commit 3311722
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"symfony/yaml": "~3.0 || ~4.0 || ~5.0",
"symfony/routing": "~3.0 || ~4.0 || ~5.0",
"pagerfanta/pagerfanta": "~1.0",
"twig/twig": "^1.12 || ^2.0"
"twig/twig": "^1.34 || ^2.0 || ^3.0"
},
"suggest": {
"symfony/yaml": "To use yaml based configuration.",
Expand Down
6 changes: 4 additions & 2 deletions src/Twig/Extension/LinkExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
namespace Hateoas\Twig\Extension;

use Hateoas\Helper\LinkHelper;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;

class LinkExtension extends \Twig_Extension
class LinkExtension extends AbstractExtension
{
/**
* @var LinkHelper
Expand All @@ -24,7 +26,7 @@ public function __construct(LinkHelper $linkHelper)
public function getFunctions()
{
return [
new \Twig_SimpleFunction('link_href', [$this->linkHelper, 'getLinkHref']),
new TwigFunction('link_href', [$this->linkHelper, 'getLinkHref']),
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
use Hateoas\HateoasBuilder;
use Hateoas\Twig\Extension\LinkExtension;
use Hateoas\UrlGenerator\CallableUrlGenerator;
use Twig\Test\IntegrationTestCase;

class LinkExtensionIntegrationTest extends \Twig_Test_IntegrationTestCase
class LinkExtensionIntegrationTest extends IntegrationTestCase
{
public function getExtensions()
{
Expand Down

0 comments on commit 3311722

Please sign in to comment.