Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Scope error when static method is intercepted #27

Closed
lisachenko opened this Issue Dec 28, 2012 · 2 comments

Comments

Projects
None yet
1 participant
Owner

lisachenko commented Dec 28, 2012

There is a scope error: Cannot access property ComposerAutoloaderInitXXX::$loader when trying to intercept static method that uses access to the private fields. This happens due to scope rebinding for LSB support, however, private fields will be in another (parent) scope, so there is an error.

@lisachenko lisachenko added a commit that referenced this issue Dec 28, 2012

@lisachenko lisachenko #27 fix scope error and preserve LSB by forwarding request in closure…
… that is rebinded to child
82818f2

@lisachenko lisachenko added a commit that referenced this issue Dec 28, 2012

@lisachenko lisachenko #27 there is no need to pass parent class name to the forward_static_…
…call_array because 'parent' string do the same
bfac83f

@lisachenko lisachenko closed this Dec 28, 2012

Owner

lisachenko commented Dec 28, 2012

Closure method invocation should be used with dynamic methods for 5.4 too, because ReflectionMethodInvocation doesn't preserve LSB for dynamic calls

@lisachenko lisachenko reopened this Dec 28, 2012

@lisachenko lisachenko added a commit that referenced this issue Dec 30, 2012

@lisachenko lisachenko #27 can not use parent::methodName() with interceptors, LSB, inherita…
…nce and correct scope, so switch to forwarding calls to explicit parents
27f8a35
Owner

lisachenko commented Dec 30, 2012

Yeah, fixed it...It was so difficult to make this possible ) LSB, inheritance and scopes in PHP for static methods aren't easy to preserve when extending logic of calling.

@lisachenko lisachenko closed this Dec 30, 2012

@genkiroid genkiroid pushed a commit to genkiroid/framework that referenced this issue Jun 23, 2016

@TrustNik TrustNik Fix issue #27 256edc3

@genkiroid genkiroid pushed a commit to genkiroid/framework that referenced this issue Jun 23, 2016

@DavertMik DavertMik Merge pull request #28 from TrustNik/patch-1
Fix issue #27
55d71b7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment