Skip to content

Private properties, final meta class - #24

Open
jakubkulhan wants to merge 7 commits into
skrz:masterfrom
jakubkulhan:closure-access
Open

Private properties, final meta class#24
jakubkulhan wants to merge 7 commits into
skrz:masterfrom
jakubkulhan:closure-access

Conversation

@jakubkulhan

Copy link
Copy Markdown
Contributor

This PR refactors generated meta classes to use Closure::bind() hack - closure can be (re-)bound to a class scope, therefore it may access everything class' methods can access, i.e. private fields. Closure is created on-demand when method that needs it is called and it is cached - therefore this should introduce almost none performance degradation or greater memory consumption, however, I haven't run any benchmarks.

In addition to accessing private fields, this also permits creating meta classes for final classes as meta class don't need to extend original class anymore.

I've also bumped PHP version to 7.1, updated PHPUnit and did some cleanup.

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.

1 participant