Skip to content

Commit

Permalink
Updates for twig 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nacmartin committed Dec 30, 2019
1 parent c051d1f commit 5379aa0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"require": {
"php": ">=5.5.0",
"nacmartin/phpexecjs": "^3.0",
"twig/twig": "^1.20|^2.0|^3.0"
"twig/twig": "^3.0"
},
"require-dev": {
"squizlabs/php_codesniffer": "^2.5",
Expand Down
12 changes: 7 additions & 5 deletions src/Limenius/ReactRenderer/Twig/ReactRenderExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
namespace Limenius\ReactRenderer\Twig;

use Psr\Cache\CacheItemPoolInterface;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
use Limenius\ReactRenderer\Renderer\AbstractReactRenderer;
use Limenius\ReactRenderer\Context\ContextProviderInterface;

class ReactRenderExtension extends \Twig_Extension
class ReactRenderExtension extends AbstractExtension
{
protected $renderServerSide = false;
protected $renderClientSide = false;
Expand Down Expand Up @@ -51,10 +53,10 @@ public function setCache(CacheItemPoolInterface $cache)
public function getFunctions(): array
{
return array(
new \Twig_SimpleFunction('react_component', array($this, 'reactRenderComponent'), array('is_safe' => array('html'))),
new \Twig_SimpleFunction('react_component_array', array($this, 'reactRenderComponentArray'), array('is_safe' => array('html'))),
new \Twig_SimpleFunction('redux_store', array($this, 'reactReduxStore'), array('is_safe' => array('html'))),
new \Twig_SimpleFunction('react_flush_buffer', array($this, 'reactFlushBuffer'), array('is_safe' => array('html'))),
new TwigFunction('react_component', array($this, 'reactRenderComponent'), array('is_safe' => array('html'))),
new TwigFunction('react_component_array', array($this, 'reactRenderComponentArray'), array('is_safe' => array('html'))),
new TwigFunction('redux_store', array($this, 'reactReduxStore'), array('is_safe' => array('html'))),
new TwigFunction('react_flush_buffer', array($this, 'reactFlushBuffer'), array('is_safe' => array('html'))),
);
}

Expand Down

0 comments on commit 5379aa0

Please sign in to comment.