@@ -1538,17 +1538,19 @@ public function getMethodParameters($stackPtr)
1538
1538
* The format of the return value is:
1539
1539
* <code>
1540
1540
* array(
1541
- * 'scope' => 'public', // Public, private, or protected
1542
- * 'scope_specified' => true, // TRUE if the scope keyword was found.
1543
- * 'return_type' => '', // The return type of the method.
1544
- * 'return_type_token' => integer, // The stack pointer to the start of the return type
1545
- * // or FALSE if there is no return type.
1546
- * 'nullable_return_type' => false, // TRUE if the return type is preceded by the
1547
- * // nullability operator.
1548
- * 'is_abstract' => false, // TRUE if the abstract keyword was found.
1549
- * 'is_final' => false, // TRUE if the final keyword was found.
1550
- * 'is_static' => false, // TRUE if the static keyword was found.
1551
- * 'has_body' => false, // TRUE if the method has a body
1541
+ * 'scope' => 'public', // Public, private, or protected
1542
+ * 'scope_specified' => true, // TRUE if the scope keyword was found.
1543
+ * 'return_type' => '', // The return type of the method.
1544
+ * 'return_type_token' => integer, // The stack pointer to the start of the return type
1545
+ * // or FALSE if there is no return type.
1546
+ * 'return_type_end_token' => integer, // The stack pointer to the end of the return type
1547
+ * // or FALSE if there is no return type.
1548
+ * 'nullable_return_type' => false, // TRUE if the return type is preceded by the
1549
+ * // nullability operator.
1550
+ * 'is_abstract' => false, // TRUE if the abstract keyword was found.
1551
+ * 'is_final' => false, // TRUE if the final keyword was found.
1552
+ * 'is_static' => false, // TRUE if the static keyword was found.
1553
+ * 'has_body' => false, // TRUE if the method has a body
1552
1554
* );
1553
1555
* </code>
1554
1556
*
@@ -1627,6 +1629,7 @@ public function getMethodProperties($stackPtr)
1627
1629
1628
1630
$ returnType = '' ;
1629
1631
$ returnTypeToken = false ;
1632
+ $ returnTypeEndToken = false ;
1630
1633
$ nullableReturnType = false ;
1631
1634
$ hasBody = true ;
1632
1635
@@ -1666,9 +1669,10 @@ public function getMethodProperties($stackPtr)
1666
1669
$ returnTypeToken = $ i ;
1667
1670
}
1668
1671
1669
- $ returnType .= $ this ->tokens [$ i ]['content ' ];
1672
+ $ returnType .= $ this ->tokens [$ i ]['content ' ];
1673
+ $ returnTypeEndToken = $ i ;
1670
1674
}
1671
- }
1675
+ }//end for
1672
1676
1673
1677
if ($ this ->tokens [$ stackPtr ]['code ' ] === T_FN ) {
1674
1678
$ bodyToken = T_FN_ARROW ;
@@ -1685,15 +1689,16 @@ public function getMethodProperties($stackPtr)
1685
1689
}
1686
1690
1687
1691
return [
1688
- 'scope ' => $ scope ,
1689
- 'scope_specified ' => $ scopeSpecified ,
1690
- 'return_type ' => $ returnType ,
1691
- 'return_type_token ' => $ returnTypeToken ,
1692
- 'nullable_return_type ' => $ nullableReturnType ,
1693
- 'is_abstract ' => $ isAbstract ,
1694
- 'is_final ' => $ isFinal ,
1695
- 'is_static ' => $ isStatic ,
1696
- 'has_body ' => $ hasBody ,
1692
+ 'scope ' => $ scope ,
1693
+ 'scope_specified ' => $ scopeSpecified ,
1694
+ 'return_type ' => $ returnType ,
1695
+ 'return_type_token ' => $ returnTypeToken ,
1696
+ 'return_type_end_token ' => $ returnTypeEndToken ,
1697
+ 'nullable_return_type ' => $ nullableReturnType ,
1698
+ 'is_abstract ' => $ isAbstract ,
1699
+ 'is_final ' => $ isFinal ,
1700
+ 'is_static ' => $ isStatic ,
1701
+ 'has_body ' => $ hasBody ,
1697
1702
];
1698
1703
1699
1704
}//end getMethodProperties()
0 commit comments