@@ -1556,17 +1556,19 @@ public function getMethodParameters($stackPtr)
1556
1556
* The format of the return value is:
1557
1557
* <code>
1558
1558
* array(
1559
- * 'scope' => 'public', // Public, private, or protected
1560
- * 'scope_specified' => true, // TRUE if the scope keyword was found.
1561
- * 'return_type' => '', // The return type of the method.
1562
- * 'return_type_token' => integer, // The stack pointer to the start of the return type
1563
- * // or FALSE if there is no return type.
1564
- * 'nullable_return_type' => false, // TRUE if the return type is preceded by the
1565
- * // nullability operator.
1566
- * 'is_abstract' => false, // TRUE if the abstract keyword was found.
1567
- * 'is_final' => false, // TRUE if the final keyword was found.
1568
- * 'is_static' => false, // TRUE if the static keyword was found.
1569
- * 'has_body' => false, // TRUE if the method has a body
1559
+ * 'scope' => 'public', // Public, private, or protected
1560
+ * 'scope_specified' => true, // TRUE if the scope keyword was found.
1561
+ * 'return_type' => '', // The return type of the method.
1562
+ * 'return_type_token' => integer, // The stack pointer to the start of the return type
1563
+ * // or FALSE if there is no return type.
1564
+ * 'return_type_end_token' => integer, // The stack pointer to the end of the return type
1565
+ * // or FALSE if there is no return type.
1566
+ * 'nullable_return_type' => false, // TRUE if the return type is preceded by the
1567
+ * // nullability operator.
1568
+ * 'is_abstract' => false, // TRUE if the abstract keyword was found.
1569
+ * 'is_final' => false, // TRUE if the final keyword was found.
1570
+ * 'is_static' => false, // TRUE if the static keyword was found.
1571
+ * 'has_body' => false, // TRUE if the method has a body
1570
1572
* );
1571
1573
* </code>
1572
1574
*
@@ -1645,6 +1647,7 @@ public function getMethodProperties($stackPtr)
1645
1647
1646
1648
$ returnType = '' ;
1647
1649
$ returnTypeToken = false ;
1650
+ $ returnTypeEndToken = false ;
1648
1651
$ nullableReturnType = false ;
1649
1652
$ hasBody = true ;
1650
1653
@@ -1684,9 +1687,10 @@ public function getMethodProperties($stackPtr)
1684
1687
$ returnTypeToken = $ i ;
1685
1688
}
1686
1689
1687
- $ returnType .= $ this ->tokens [$ i ]['content ' ];
1690
+ $ returnType .= $ this ->tokens [$ i ]['content ' ];
1691
+ $ returnTypeEndToken = $ i ;
1688
1692
}
1689
- }
1693
+ }//end for
1690
1694
1691
1695
if ($ this ->tokens [$ stackPtr ]['code ' ] === T_FN ) {
1692
1696
$ bodyToken = T_FN_ARROW ;
@@ -1703,15 +1707,16 @@ public function getMethodProperties($stackPtr)
1703
1707
}
1704
1708
1705
1709
return [
1706
- 'scope ' => $ scope ,
1707
- 'scope_specified ' => $ scopeSpecified ,
1708
- 'return_type ' => $ returnType ,
1709
- 'return_type_token ' => $ returnTypeToken ,
1710
- 'nullable_return_type ' => $ nullableReturnType ,
1711
- 'is_abstract ' => $ isAbstract ,
1712
- 'is_final ' => $ isFinal ,
1713
- 'is_static ' => $ isStatic ,
1714
- 'has_body ' => $ hasBody ,
1710
+ 'scope ' => $ scope ,
1711
+ 'scope_specified ' => $ scopeSpecified ,
1712
+ 'return_type ' => $ returnType ,
1713
+ 'return_type_token ' => $ returnTypeToken ,
1714
+ 'return_type_end_token ' => $ returnTypeEndToken ,
1715
+ 'nullable_return_type ' => $ nullableReturnType ,
1716
+ 'is_abstract ' => $ isAbstract ,
1717
+ 'is_final ' => $ isFinal ,
1718
+ 'is_static ' => $ isStatic ,
1719
+ 'has_body ' => $ hasBody ,
1715
1720
];
1716
1721
1717
1722
}//end getMethodProperties()
0 commit comments