Permalink
Browse files

Improved the Zend compatibility for ReflectionClass

Summary: `inNamespace()`, `getNamespaceName()`, and `getShortName()` should not be `final`. This was causing issues in phpspec which mocks these methods.

This was done for ReflectionFunctionAbstract in #3070 but ReflectionClass was missed

Closes #3233

Reviewed By: @ptarjan

Differential Revision: D1445618
  • Loading branch information...
1 parent 4788837 commit 8c10077c1ef5986c888f22724b26622521a1dae2 svcscm committed with facebook-github-bot Jul 20, 2014
Showing with 3 additions and 3 deletions.
  1. +3 −3 hphp/runtime/ext/reflection/ext_reflection_hni.php
View
6 hphp/runtime/ext/reflection/ext_reflection_hni.php
@@ -1323,7 +1323,7 @@ private function getParentName(): string;
*
* @return bool Returns TRUE on success or FALSE on failure.
*/
- final public function inNamespace(): bool {
+ public function inNamespace(): bool {
return strrpos($this->getName(), '\\') !== false;
}
@@ -1335,7 +1335,7 @@ private function getParentName(): string;
*
* @return string The namespace name.
*/
- final public function getNamespaceName(): string {
+ public function getNamespaceName(): string {
$name = $this->getName();
$pos = strrpos($name, '\\');
return ($pos === false) ? '' : substr($name, 0, $pos);
@@ -1349,7 +1349,7 @@ private function getParentName(): string;
*
* @return string The short name of the function.
*/
- final public function getShortName(): string {
+ public function getShortName(): string {
$name = $this->getName();
$pos = strrpos($name, '\\');
return ($pos === false) ? $name : substr($name, $pos + 1);

2 comments on commit 8c10077

@staabm

@ptarjan seems like the origin author was los

@SiebelsTim

@staabm This currently happens to all github PRs

Please sign in to comment.