File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed
src/Naneau/Obfuscator/Node/Visitor Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,9 @@ public function beforeTraverse(array $nodes)
57
57
->resetRenamed ()
58
58
->skip ($ this ->variableMethodCallsUsed ($ nodes ));
59
59
60
- $ this ->scanMethodDefinitions ($ nodes );
60
+ if (!$ this ->shouldSkip ()) {
61
+ $ this ->scanMethodDefinitions ($ nodes );
62
+ }
61
63
62
64
return $ nodes ;
63
65
}
@@ -95,7 +97,7 @@ public function enterNode(Node $node)
95
97
private function variableMethodCallsUsed (array $ nodes )
96
98
{
97
99
foreach ($ nodes as $ node ) {
98
- if ($ node instanceof MethodCall && $ node ->name instanceof Variable) {
100
+ if ($ node instanceof MethodCall && $ node ->name instanceof Variable && $ node -> var -> name === " this " ) {
99
101
// A method call uses a Variable as its name
100
102
return true ;
101
103
}
Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ public function publicMethod() {
37
37
$ this ->publicProperty = $ localVar ;
38
38
$ this ->_protectedMethod ();
39
39
$ this ->_privateMethod ();
40
+ $ dt = new \DateTime ();
41
+ $ dtMethodName = "getTimestamp " ;
42
+ $ dt ->$ dtMethodName ();
40
43
}
41
44
}
42
45
Original file line number Diff line number Diff line change 1
1
<?php
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 ();
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 (); $ spce0ae5 = new \DateTime (); $ sp167220 = "getTimestamp " ; $ spce0ae5 ->{$ sp167220 }(); } } $ sp5de0e2 = new SimpleClass (); $ sp5de0e2 ->publicMethod ();
You can’t perform that action at this time.
0 commit comments