Skip to content

Commit 8a1aaa3

Browse files
author
Aaron Stephens
committed
Modified wrapper reflection to skip enumerating constructor.
Updated test wrapper 'Dog' with constructor to ensure constructor is not in enumerated methods.
1 parent fcb602f commit 8a1aaa3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/DNode/Session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ private function scrub($obj)
133133
$reflector = new \ReflectionClass($node);
134134
$methods = $reflector->getMethods();
135135
foreach ($methods as $method) {
136-
if (!$method->isPublic()) {
136+
if (!$method->isPublic() || $method->isConstructor()) {
137137
continue;
138138
}
139139

tests/DNode/Dog.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33

44
class Dog
55
{
6+
public function __construct()
7+
{
8+
9+
}
10+
611
public function bark()
712
{
813
}

0 commit comments

Comments
 (0)