@@ -34,7 +34,7 @@ |
||
| 34 | 34 | /** |
| 35 | 35 | * Constructor |
| 36 | 36 | * |
| 37 | - * @return void |
|
| 37 | + * @return Container |
|
| 38 | 38 | **/ |
| 39 | 39 | public function __construct() |
| 40 | 40 | { |
@@ -9,7 +9,6 @@ |
||
| 9 | 9 | namespace Naneau\Obfuscator\Node\Visitor; |
| 10 | 10 | |
| 11 | 11 | use Naneau\Obfuscator\StringScrambler; |
| 12 | - |
|
| 13 | 12 | use PhpParser\NodeVisitorAbstract; |
| 14 | 13 | use PhpParser\Node; |
| 15 | 14 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * Before node traversal |
| 50 | 50 | * |
| 51 | 51 | * @param Node[] $nodes |
| 52 | - * @return array |
|
| 52 | + * @return Node[] |
|
| 53 | 53 | **/ |
| 54 | 54 | public function beforeTraverse(array $nodes) |
| 55 | 55 | { |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | * Check all variable nodes |
| 67 | 67 | * |
| 68 | 68 | * @param Node $node |
| 69 | - * @return void |
|
| 69 | + * @return null|Node |
|
| 70 | 70 | **/ |
| 71 | 71 | public function enterNode(Node $node) |
| 72 | 72 | { |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | * Recursively scan for method calls and see if variables are used |
| 92 | 92 | * |
| 93 | 93 | * @param Node[] $nodes |
| 94 | - * @return void |
|
| 94 | + * @return boolean |
|
| 95 | 95 | **/ |
| 96 | 96 | private function variableMethodCallsUsed(array $nodes) |
| 97 | 97 | { |
@@ -11,12 +11,8 @@ |
||
| 11 | 11 | |
| 12 | 12 | use Naneau\Obfuscator\Node\Visitor\TrackingRenamerTrait; |
| 13 | 13 | use Naneau\Obfuscator\Node\Visitor\SkipTrait; |
| 14 | - |
|
| 15 | 14 | use Naneau\Obfuscator\Node\Visitor\Scrambler as ScramblerVisitor; |
| 16 | -use Naneau\Obfuscator\StringScrambler; |
|
| 17 | - |
|
| 18 | 15 | use PhpParser\Node; |
| 19 | - |
|
| 20 | 16 | use PhpParser\Node\Stmt\Class_ as ClassNode; |
| 21 | 17 | use PhpParser\Node\Stmt\ClassMethod; |
| 22 | 18 | use PhpParser\Node\Expr\MethodCall; |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * Before node traversal |
| 58 | 58 | * |
| 59 | 59 | * @param Node[] $nodes |
| 60 | - * @return array |
|
| 60 | + * @return Node[] |
|
| 61 | 61 | **/ |
| 62 | 62 | public function beforeTraverse(array $nodes) |
| 63 | 63 | { |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | * Check all variable nodes |
| 73 | 73 | * |
| 74 | 74 | * @param Node $node |
| 75 | - * @return void |
|
| 75 | + * @return null|PropertyFetch |
|
| 76 | 76 | **/ |
| 77 | 77 | public function enterNode(Node $node) |
| 78 | 78 | { |
@@ -11,19 +11,13 @@ |
||
| 11 | 11 | |
| 12 | 12 | use Naneau\Obfuscator\Node\Visitor\TrackingRenamerTrait; |
| 13 | 13 | use Naneau\Obfuscator\Node\Visitor\SkipTrait; |
| 14 | - |
|
| 15 | 14 | use Naneau\Obfuscator\Node\Visitor\Scrambler as ScramblerVisitor; |
| 16 | 15 | use Naneau\Obfuscator\StringScrambler; |
| 17 | - |
|
| 18 | 16 | use PhpParser\Node; |
| 19 | - |
|
| 20 | 17 | use PhpParser\Node\Stmt\Class_ as ClassNode; |
| 21 | 18 | use PhpParser\Node\Stmt\Property; |
| 22 | - |
|
| 23 | 19 | use PhpParser\Node\Expr\PropertyFetch; |
| 24 | 20 | |
| 25 | -use PhpParser\Node\Expr\Variable; |
|
| 26 | - |
|
| 27 | 21 | /** |
| 28 | 22 | * ScramblePrivateProperty |
| 29 | 23 | * |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | * Set the string scrambler |
| 114 | 114 | * |
| 115 | 115 | * @param StringScrambler $scrambler |
| 116 | - * @return RenameParameter |
|
| 116 | + * @return Scrambler |
|
| 117 | 117 | */ |
| 118 | 118 | public function setScrambler(StringScrambler $scrambler) |
| 119 | 119 | { |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | * Set variables to ignore |
| 137 | 137 | * |
| 138 | 138 | * @param string[] $ignore |
| 139 | - * @return parent |
|
| 139 | + * @return Scrambler |
|
| 140 | 140 | */ |
| 141 | 141 | public function setIgnore(array $ignore) |
| 142 | 142 | { |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | * Add a variable name to ignore |
| 150 | 150 | * |
| 151 | 151 | * @param string|string[] $ignore |
| 152 | - * @return RenameParameterVisitor |
|
| 152 | + * @return Scrambler |
|
| 153 | 153 | **/ |
| 154 | 154 | public function addIgnore($ignore) |
| 155 | 155 | { |
@@ -9,7 +9,6 @@ |
||
| 9 | 9 | namespace Naneau\Obfuscator\Node\Visitor; |
| 10 | 10 | |
| 11 | 11 | use Naneau\Obfuscator\StringScrambler; |
| 12 | - |
|
| 13 | 12 | use PhpParser\NodeVisitorAbstract; |
| 14 | 13 | use PhpParser\Node; |
| 15 | 14 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * Before node traversal |
| 58 | 58 | * |
| 59 | 59 | * @param Node[] $nodes |
| 60 | - * @return array |
|
| 60 | + * @return Node[] |
|
| 61 | 61 | **/ |
| 62 | 62 | public function beforeTraverse(array $nodes) |
| 63 | 63 | { |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | /** |
| 223 | 223 | * Find (the first) class node in a set of nodes |
| 224 | 224 | * |
| 225 | - * @param array $nodes |
|
| 225 | + * @param Node[] $nodes |
|
| 226 | 226 | * @return ClassStatement|bool returns falls if no class can be found |
| 227 | 227 | **/ |
| 228 | 228 | private function findClass(array $nodes) |
@@ -11,29 +11,19 @@ |
||
| 11 | 11 | |
| 12 | 12 | use Naneau\Obfuscator\Node\Visitor\TrackingRenamerTrait; |
| 13 | 13 | use Naneau\Obfuscator\Node\Visitor\SkipTrait; |
| 14 | - |
|
| 15 | 14 | use Naneau\Obfuscator\Node\Visitor\Scrambler as ScramblerVisitor; |
| 16 | - |
|
| 17 | 15 | use PhpParser\Node; |
| 18 | - |
|
| 19 | 16 | use PhpParser\Node\Name; |
| 20 | -use PhpParser\Node\Name\FullyQualified; |
|
| 21 | - |
|
| 22 | 17 | use PhpParser\Node\Param; |
| 23 | - |
|
| 24 | 18 | use PhpParser\Node\Stmt\Class_ as ClassStatement; |
| 25 | 19 | use PhpParser\Node\Stmt\Use_ as UseStatement; |
| 26 | -use PhpParser\Node\Stmt\UseUse as UseUseStatement; |
|
| 27 | 20 | use PhpParser\Node\Stmt\StaticVar; |
| 28 | - |
|
| 29 | 21 | use PhpParser\Node\Expr\ClassConstFetch; |
| 30 | 22 | use PhpParser\Node\Expr\StaticCall; |
| 31 | 23 | use PhpParser\Node\Expr\StaticPropertyFetch; |
| 32 | 24 | use PhpParser\Node\Expr\New_ as NewExpression; |
| 33 | 25 | use PhpParser\Node\Expr\Instanceof_ as InstanceOfExpression; |
| 34 | 26 | |
| 35 | -use PhpParser\Node\Expr\Variable; |
|
| 36 | - |
|
| 37 | 27 | /** |
| 38 | 28 | * ScrambleUse |
| 39 | 29 | * |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | * Check all variable nodes |
| 54 | 54 | * |
| 55 | 55 | * @param Node $node |
| 56 | - * @return void |
|
| 56 | + * @return Node|null |
|
| 57 | 57 | **/ |
| 58 | 58 | public function enterNode(Node $node) |
| 59 | 59 | { |
@@ -11,10 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | use Naneau\Obfuscator\Node\Visitor\Scrambler as ScramblerVisitor; |
| 13 | 13 | use Naneau\Obfuscator\StringScrambler; |
| 14 | - |
|
| 15 | -use PhpParser\NodeVisitorAbstract; |
|
| 16 | 14 | use PhpParser\Node; |
| 17 | -use PhpParser\Node\Stmt; |
|
| 18 | 15 | use PhpParser\Node\Param; |
| 19 | 16 | use PhpParser\Node\Expr\Variable; |
| 20 | 17 | use PhpParser\Node\Stmt\Catch_ as CatchStatement; |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | * |
| 32 | 32 | * @param string $method |
| 33 | 33 | * @param string $newName |
| 34 | - * @return SkipTrait |
|
| 34 | + * @return TrackingRenamerTrait |
|
| 35 | 35 | **/ |
| 36 | 36 | protected function renamed($method, $newName) |
| 37 | 37 | { |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | /** |
| 77 | 77 | * Reset renamed list |
| 78 | 78 | * |
| 79 | - * @return SkipTrait |
|
| 79 | + * @return TrackingRenamerTrait |
|
| 80 | 80 | **/ |
| 81 | 81 | protected function resetRenamed() |
| 82 | 82 | { |
@@ -214,7 +214,8 @@ |
||
| 214 | 214 | /** |
| 215 | 215 | * Get the file list |
| 216 | 216 | * |
| 217 | - * @return SplFileInfo |
|
| 217 | + * @param string $directory |
|
| 218 | + * @return RegexIterator |
|
| 218 | 219 | **/ |
| 219 | 220 | private function getFiles($directory) |
| 220 | 221 | { |
@@ -9,13 +9,9 @@ |
||
| 9 | 9 | namespace Naneau\Obfuscator; |
| 10 | 10 | |
| 11 | 11 | use Naneau\Obfuscator\Obfuscator\Event\File as FileEvent; |
| 12 | - |
|
| 13 | 12 | use PhpParser\NodeTraverserInterface as NodeTraverser; |
| 14 | - |
|
| 15 | 13 | use PhpParser\Parser; |
| 16 | -use PhpParser\Lexer; |
|
| 17 | 14 | use PhpParser\PrettyPrinter\Standard as PrettyPrinter; |
| 18 | - |
|
| 19 | 15 | use Symfony\Component\EventDispatcher\EventDispatcher; |
| 20 | 16 | |
| 21 | 17 | use \RegexIterator; |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * Constructor |
| 33 | 33 | * |
| 34 | 34 | * @param string $file |
| 35 | - * @return void |
|
| 35 | + * @return null|Event |
|
| 36 | 36 | **/ |
| 37 | 37 | public function __construct($file) |
| 38 | 38 | { |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * Set the file |
| 54 | 54 | * |
| 55 | 55 | * @param string $file |
| 56 | - * @return parent |
|
| 56 | + * @return File |
|
| 57 | 57 | */ |
| 58 | 58 | public function setFile($file) |
| 59 | 59 | { |