Skip to content

Conversation

brettmc
Copy link
Contributor

@brettmc brettmc commented Aug 25, 2025

This pull request introduces improvements to function introspection in the phper library and updates documentation to reflect a more accurate parameter type. The most important changes are the addition of new methods for retrieving a function's declaration line numbers, a clarification in a documentation example, and a minor renaming for clarity.

Function Introspection Enhancements:

  • Added get_line_start and get_line_end methods to the ZFunc struct in phper/src/functions.rs, allowing retrieval of the start and end line numbers for user-defined and evaluated functions.

Documentation Update:

  • Updated the documentation example in phper-doc/doc/_06_module/_02_register_functions/index.md to show the parameter type as ?\MyNamespace\MyInterface instead of ?class_name, reflecting the actual interface type used.

Codebase Consistency:

  • Renamed the method get_lineno to get_opline_lineno in the ExecuteData struct in phper/src/values.rs for improved clarity regarding its purpose.

function line number represents the first line of the definition of
the currently executing function, which can differ from execute_data.opcode
rename execute_data.get_lineno to get_opline_lineno to better describe
what the value is
class_name was a bug, but I missed the doc update when fixing this
previously
@brettmc brettmc marked this pull request as ready for review August 25, 2025 06:24
@jmjoy jmjoy merged commit 84adb0b into phper-framework:master Aug 25, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants