Skip to content

Commit 7292789

Browse files
committed
Merge branch 'release/0.0.13'
2 parents 37b59ed + f07c445 commit 7292789

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
CHANGELOG
22
=========
33

4+
0.0.13
5+
-----
6+
Issue #2 : allow backslash for function/method parameter type
7+
48
0.0.12
59
-----
610
Refactoring : Use statements and Namespace are contained by a file not a class as each element should only knows what it contains not what that is around itself.

Element/PhpFunctionParameter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function setType($type)
3737
*/
3838
public static function typeIsValid($type)
3939
{
40-
return $type === null || self::stringIsValid($type) || $type instanceof PhpClass;
40+
return $type === null || self::stringIsValid($type, true, true) || $type instanceof PhpClass;
4141
}
4242
/**
4343
* @return string|PhpClass

Tests/Element/PhpFunctionParameterTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,11 @@ public function testToStringEmptyArrayValue()
4848

4949
$this->assertSame('array $foo = array()', $functionParameter->toString());
5050
}
51+
52+
public function testToStringWithNamespace()
53+
{
54+
$functionParameter = new PhpFunctionParameter('foo', null, 'My\Name\Space');
55+
56+
$this->assertSame('My\Name\Space $foo = null', $functionParameter->toString());
57+
}
5158
}

0 commit comments

Comments
 (0)