Skip to content

FunctionDeclarations::getProperties(): add caching - #464

Merged
jrfnl merged 1 commit into
developfrom
utils/functiondeclarations-getproperties-add-caching
Apr 29, 2023
Merged

jrfnl merged 1 commit into
developfrom
utils/functiondeclarations-getproperties-add-caching

Conversation

@jrfnl

@jrfnl jrfnl commented Apr 29, 2023

Copy link
Copy Markdown
Member

Follow up on #332

While parsing the properties of function declarations was reasonably straight forward, with the introduction of union type in PHP 8.0, intersection types in PHP 8.1 and disjunctive normal form types in PHP 8.2, the retrieving of the return type has become more token walking intensive.

With that in mind, caching the results of the function seems prudent.

Includes a dedicated test to verify the cache is used and working.

Follow up on 332

While parsing the properties of function declarations was reasonably straight forward, with the introduction of union type in PHP 8.0, intersection types in PHP 8.1 and disjunctive normal form types in PHP 8.2, the retrieving of the return type has become more token walking intensive.

With that in mind, caching the results of the function seems prudent.

Includes a dedicated test to verify the cache is used and working.
@jrfnl jrfnl added this to the 1.0.x Next milestone Apr 29, 2023
@jrfnl
jrfnl merged commit bad9681 into develop Apr 29, 2023
@jrfnl
jrfnl deleted the utils/functiondeclarations-getproperties-add-caching branch April 29, 2023 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant