Skip to content

Commit c6d86d7

Browse files
author
Younès El Biache
committed
replace deprecated twig methods but errors in test to fix
1 parent 995e337 commit c6d86d7

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

src/Ladybug/Renderer/Twig/Extension/BaseExtension.php

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ public function getName()
4040
public function getFunctions()
4141
{
4242
return array(
43-
'render_type' => new \Twig_Function_Method(
44-
$this,
45-
'renderTypeFunction',
43+
'render_type' => new \Twig_SimpleFunction(
44+
'renderTypeFunction',
45+
array($this, 'renderTypeFunction'),
4646
array('needs_environment' => true, 'is_safe' => array('html'))
4747
)
4848
);
@@ -56,16 +56,8 @@ public function getFunctions()
5656
public function getFilters()
5757
{
5858
return array(
59-
'repeat' => new \Twig_Filter_Method(
60-
$this,
61-
'getRepeat',
62-
array('is_safe' => array('html'))
63-
),
64-
'pad' => new \Twig_Filter_Method(
65-
$this,
66-
'getPad',
67-
array()
68-
)
59+
'repeat' => new \Twig_SimpleFilter('getRepeat', array($this, 'getRepeat'), array('is_safe' => array('html'))),
60+
'pad' => new \Twig_SimpleFilter('getPad', array($this, 'getPad')),
6961
);
7062
}
7163

src/Ladybug/Renderer/Twig/Extension/ConsoleExtension.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@ public function getName()
3232
public function getFilters()
3333
{
3434
return array_merge(parent::getFilters(), array(
35-
'tags' => new \Twig_Filter_Method(
36-
$this,
37-
'getTags',
38-
array('is_safe' => array('html'))
39-
)
35+
'tags' => new \Twig_SimpleFilter('getTags', array($this, 'getTags'), array('is_safe' => array('html'))),
4036
));
4137
}
4238

0 commit comments

Comments
 (0)