Skip to content

Commit 7f5cf2a

Browse files
committed
May Jenkins bless this commit
1 parent 6af1b76 commit 7f5cf2a

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/PhpDocReader/PhpDocReader.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,12 @@ private function tryResolveFqn($type, ReflectionClass $class, Reflector $member)
247247
// No namespace
248248
return $type;
249249
}
250-
251-
return $this->tryResolveFqnInTraits($type, $class, $member);
250+
251+
if (version_compare(phpversion(), '5.4.0', '<')) {
252+
return null;
253+
} else {
254+
return $this->tryResolveFqnInTraits($type, $class, $member);
255+
}
252256
}
253257

254258
/**

tests/Issue335Test.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ class Issue335Test extends PHPUnit_Framework_TestCase
1818
*/
1919
public function testNamespaceResolutionForTraits()
2020
{
21+
if (version_compare(phpversion(), '5.4.0', '<')) {
22+
$this->markTestSkipped('Traits were introduced in PHP 5.4');
23+
return;
24+
}
25+
2126
$parser = new PhpDocReader();
2227

2328
$target = new Class3();

0 commit comments

Comments
 (0)