Skip to content

Commit 755310f

Browse files
committed
Merge remote-tracking branch 'astephens25/reflection-fix'
* astephens25/reflection-fix: Removed destructor from methods enumeration. Updated Dog test class with destructor. Modified wrapper reflection to skip enumerating constructor. Updated test wrapper 'Dog' with constructor to ensure constructor is not in enumerated methods.
2 parents fcb602f + 3ee8aea commit 755310f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-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() || $method->isDestructor()) {
137137
continue;
138138
}
139139

tests/DNode/Dog.php

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

44
class Dog
55
{
6+
public function __construct()
7+
{
8+
}
9+
10+
public function __destruct()
11+
{
12+
}
13+
614
public function bark()
715
{
816
}

0 commit comments

Comments
 (0)