File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed
src/Naneau/Obfuscator/Node/Visitor Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,17 @@ public function enterNode(Node $node)
87
87
return $ node ;
88
88
}
89
89
}
90
+
91
+ if ($ node instanceof Node \Expr \StaticPropertyFetch) {
92
+ if ((string )$ node ->class !== "self " ) {
93
+ return ;
94
+ }
95
+
96
+ if ($ this ->isRenamed ($ node ->name )) {
97
+ $ node ->name = $ this ->getNewName ($ node ->name );
98
+ return $ node ;
99
+ }
100
+ }
90
101
}
91
102
92
103
/**
Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ class SimpleClass {
4
4
5
5
const CONSTANT_VARIABLE = "test " ;
6
6
7
- static $ staticProperty = "test " ;
7
+ public static $ publicStaticProperty = "test " ;
8
+ protected static $ protectedStaticProperty = "test " ;
9
+ private static $ _privateStaticProperty = "test " ;
10
+
8
11
9
12
private $ _privateProperty ;
10
13
protected $ _protectedProperty ;
@@ -15,6 +18,9 @@ private function _privateMethod() {
15
18
$ this ->_privateProperty = $ localVar ;
16
19
$ this ->_protectedProperty = $ localVar ;
17
20
$ this ->publicProperty = $ localVar ;
21
+ self ::$ publicStaticProperty = "test " ;
22
+ self ::$ protectedStaticProperty = "test " ;
23
+ self ::$ _privateStaticProperty = "test " ;
18
24
}
19
25
20
26
protected function _protectedMethod () {
Original file line number Diff line number Diff line change 1
1
<?php
2
- class SimpleClass { const CONSTANT_VARIABLE = "test " ; static $ staticProperty = "test " ; private $ sp8839d9 ; protected $ _protectedProperty ; public $ publicProperty ; private function sp51fa3f () { $ spd8dce8 = "test " ; $ this ->sp8839d9 = $ spd8dce8 ; $ this ->_protectedProperty = $ spd8dce8 ; $ this ->publicProperty = $ spd8dce8 ; } protected function _protectedMethod () { $ spd8dce8 = "test " ; $ this ->sp8839d9 = $ spd8dce8 ; $ this ->_protectedProperty = $ spd8dce8 ; $ this ->publicProperty = $ spd8dce8 ; } public function publicMethod () { $ spd8dce8 = "test " ; $ this ->sp8839d9 = $ spd8dce8 ; $ this ->_protectedProperty = $ spd8dce8 ; $ this ->publicProperty = $ spd8dce8 ; $ this ->_protectedMethod (); $ this ->sp51fa3f (); } } $ sp5de0e2 = new SimpleClass (); $ sp5de0e2 ->publicMethod ();
2
+ class SimpleClass { const CONSTANT_VARIABLE = "test " ; public static $ publicStaticProperty = "test " ; protected static $ protectedStaticProperty = " test " ; private static $ sp39db2b = " test " ; private $ sp8839d9 ; protected $ _protectedProperty ; public $ publicProperty ; private function sp51fa3f () { $ spd8dce8 = "test " ; $ this ->sp8839d9 = $ spd8dce8 ; $ this ->_protectedProperty = $ spd8dce8 ; $ this ->publicProperty = $ spd8dce8; self :: $ publicStaticProperty = " test " ; self :: $ protectedStaticProperty = " test " ; self :: $ sp39db2b = " test " ; } protected function _protectedMethod () { $ spd8dce8 = "test " ; $ this ->sp8839d9 = $ spd8dce8 ; $ this ->_protectedProperty = $ spd8dce8 ; $ this ->publicProperty = $ spd8dce8 ; } public function publicMethod () { $ spd8dce8 = "test " ; $ this ->sp8839d9 = $ spd8dce8 ; $ this ->_protectedProperty = $ spd8dce8 ; $ this ->publicProperty = $ spd8dce8 ; $ this ->_protectedMethod (); $ this ->sp51fa3f (); } } $ sp5de0e2 = new SimpleClass (); $ sp5de0e2 ->publicMethod ();
You can’t perform that action at this time.
0 commit comments