Skip to content

Commit

Permalink
Update for symfony 5 (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
vindert authored Dec 12, 2021
1 parent 2b35301 commit ce759bb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
}
],
"require": {
"php": ">=5.3.9",
"symfony/framework-bundle": "~2.3||3.*||4.*",
"php": ">=7.0",
"symfony/framework-bundle": "~2.3||3.*||4.*||5.*||6.*",
"caxy/php-htmldiff": "~0.1"
},
"require-dev": {
Expand Down
12 changes: 6 additions & 6 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ class Configuration implements ConfigurationInterface
/**
* {@inheritDoc}
*/
public function getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('caxy_html_diff');
$treeBuilder = new TreeBuilder('caxy_html_diff');
$rootNode = $treeBuilder->getRootNode();

$rootNode
->children()
Expand Down Expand Up @@ -52,10 +52,10 @@ public function getConfigTreeBuilder()
*
* @return ArrayNodeDefinition
*/
private function getDoctrineCacheDriverNode($name)
private function getDoctrineCacheDriverNode($name): ArrayNodeDefinition
{
$treeBuilder = new TreeBuilder();
$node = $treeBuilder->root($name);
$treeBuilder = new TreeBuilder($name);
$node = $treeBuilder->getRootNode();
$node
->canBeEnabled()
->beforeNormalization()
Expand Down
10 changes: 5 additions & 5 deletions src/Twig/HtmlDiffExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Caxy\HtmlDiffBundle\Service\HtmlDiffService;

class HtmlDiffExtension extends \Twig_Extension
class HtmlDiffExtension extends \Twig\Extension\AbstractExtension
{
protected $container;

Expand All @@ -15,10 +15,10 @@ public function __construct(HtmlDiffService $htmlDiff)
$this->htmlDiff = $htmlDiff;
}

public function getFunctions()
public function getFunctions(): array
{
return array(
new \Twig_SimpleFunction('htmldiff', array($this, 'htmlDiff'), array('is_safe' => array('html'))),
new \Twig\TwigFunction('htmldiff', array($this, 'htmlDiff'), array('is_safe' => array('html'))),
);
}

Expand All @@ -27,8 +27,8 @@ public function htmlDiff($a, $b)
return $this->htmlDiff->diff((string) $a, (string) $b);
}

public function getName()
public function getName(): string
{
return 'caxy_htmldiff_extension';
}
}
}

0 comments on commit ce759bb

Please sign in to comment.