Skip to content

Commit c0d6d66

Browse files
committed
Merge pull request #72 from younes0/master
renamed Type classes for php7 support
2 parents 5c27eb1 + c6d86d7 commit c0d6d66

21 files changed

+57
-68
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ php:
55
- 5.4
66
- 5.5
77
- 5.6
8+
- 7.0
89
- hhvm-nightly
910

1011
matrix:

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

src/Ladybug/Resources/container/types.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@
66

77
<services>
88

9-
<service id="type_null" class="Ladybug\Type\Null">
9+
<service id="type_null" class="Ladybug\Type\NullType">
1010
<tag name="ladybug.type" />
1111
</service>
1212

13-
<service id="type_bool" class="Ladybug\Type\Bool">
13+
<service id="type_bool" class="Ladybug\Type\BoolType">
1414
<tag name="ladybug.type" />
1515
</service>
1616

17-
<service id="type_int" class="Ladybug\Type\Int">
17+
<service id="type_int" class="Ladybug\Type\IntType">
1818
<tag name="ladybug.type" />
1919
</service>
2020

21-
<service id="type_float" class="Ladybug\Type\Float">
21+
<service id="type_float" class="Ladybug\Type\FloatType">
2222
<tag name="ladybug.type" />
2323
</service>
2424

25-
<service id="type_string" class="Ladybug\Type\String">
25+
<service id="type_string" class="Ladybug\Type\StringType">
2626
<tag name="ladybug.type" />
2727
</service>
2828

@@ -41,7 +41,7 @@
4141
<tag name="ladybug.type" />
4242
</service>
4343

44-
<service id="type_resource" class="Ladybug\Type\Resource">
44+
<service id="type_resource" class="Ladybug\Type\ResourceType">
4545
<argument type="service" id="type_factory"></argument>
4646
<argument type="service" id="inspector_manager"></argument>
4747
<argument type="service" id="metadata_resolver"></argument>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/**
1717
* Bool is an abstraction of a primitive variable of type 'bool'
1818
*/
19-
class Bool extends AbstractType
19+
class BoolType extends AbstractType
2020
{
2121

2222
const TYPE_ID = 'bool';
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/**
1717
* Float is an abstraction of a primitive variable of type 'float'
1818
*/
19-
class Float extends AbstractType
19+
class FloatType extends AbstractType
2020
{
2121

2222
const TYPE_ID = 'float';
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/**
1717
* Int is an abstraction of a primitive variable of type 'int'
1818
*/
19-
class Int extends AbstractType
19+
class IntType extends AbstractType
2020
{
2121

2222
const TYPE_ID = 'int';
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/**
1717
* Null is an abstraction of a primitive variable of type 'null'
1818
*/
19-
class Null extends AbstractType
19+
class NullType extends AbstractType
2020
{
2121
const TYPE_ID = 'null';
2222

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use Ladybug\Inspector\InspectorManager;
1919
use Ladybug\Model\VariableWrapper;
2020

21-
class Resource extends AbstractType
21+
class ResourceType extends AbstractType
2222
{
2323

2424
const TYPE_ID = 'resource';
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/**
1717
* String is an abstraction of a primitive variable of type 'string'
1818
*/
19-
class String extends AbstractType
19+
class StringType extends AbstractType
2020
{
2121
const TYPE_ID = 'string';
2222

0 commit comments

Comments
 (0)