rename getReturnTypehintText() to getReturnTypeText() to be consistent with the new API that drops the 'hint' part in the method name
Simple renaming of method for consistency reasons
Esse commit está contido em:
@@ -542,7 +542,7 @@ class ReflectionFunctionAbstract {
|
||||
return $count;
|
||||
}
|
||||
|
||||
public function getReturnTypehintText() {
|
||||
public function getReturnTypeText() {
|
||||
if (isset($this->info['return_type'])) {
|
||||
return $this->info['return_type'];
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
<?hh
|
||||
function foo(Vector<int> $z): Vector<int> { return $z; } $rf = new ReflectionFunction('foo'); var_dump($rf->getReturnTypehintText()); class C { function goo(): int { return 0; } } $rc = new ReflectionClass('C'); $rm = $rc->getMethod('goo'); var_dump($rm->getReturnTypehintText()); class C1 extends C { function goo() { return 0; } } $rc = new ReflectionClass('C1'); $rm = $rc->getMethod('goo'); var_dump($rm->getReturnTypehintText()); class C2 extends C1 { function goo(): string { return '0'; } } $rc = new ReflectionClass('C2'); $rm = $rc->getMethod('goo'); var_dump($rm->getReturnTypehintText()); interface I { function m(): string; } $rc = new ReflectionClass('I'); $rm = $rc->getMethod('m'); var_dump($rm->getReturnTypehintText()); interface I1<T> { function m(): T; } $rc = new ReflectionClass('I1'); $rm = $rc->getMethod('m'); var_dump($rm->getReturnTypehintText()); trait T { function t(): C { return new C(); } } class UseT { use T; } $rc = new ReflectionClass('UseT'); $rm = $rc->getMethod('t'); var_dump($rm->getReturnTypehintText());
|
||||
function foo(Vector<int> $z): Vector<int> { return $z; } $rf = new ReflectionFunction('foo'); var_dump($rf->getReturnTypeText()); class C { function goo(): int { return 0; } } $rc = new ReflectionClass('C'); $rm = $rc->getMethod('goo'); var_dump($rm->getReturnTypeText()); class C1 extends C { function goo() { return 0; } } $rc = new ReflectionClass('C1'); $rm = $rc->getMethod('goo'); var_dump($rm->getReturnTypeText()); class C2 extends C1 { function goo(): string { return '0'; } } $rc = new ReflectionClass('C2'); $rm = $rc->getMethod('goo'); var_dump($rm->getReturnTypeText()); interface I { function m(): string; } $rc = new ReflectionClass('I'); $rm = $rc->getMethod('m'); var_dump($rm->getReturnTypeText()); interface I1<T> { function m(): T; } $rc = new ReflectionClass('I1'); $rm = $rc->getMethod('m'); var_dump($rm->getReturnTypeText()); trait T { function t(): C { return new C(); } } class UseT { use T; } $rc = new ReflectionClass('UseT'); $rm = $rc->getMethod('t'); var_dump($rm->getReturnTypeText());
|
||||
|
||||
@@ -4,7 +4,7 @@ function printFunc($rf) {
|
||||
foreach($rps as $rp) {
|
||||
var_dump($rp->getTypeText());
|
||||
}
|
||||
var_dump($rf->getReturnTypehintText());
|
||||
var_dump($rf->getReturnTypeText());
|
||||
}
|
||||
function printClass($rc) {
|
||||
$rms = $rc->getMethods();
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário