1 | <?php |
||
27 | abstract class Scrambler extends NodeVisitorAbstract |
||
28 | { |
||
29 | /** |
||
30 | * The string scrambler |
||
31 | * |
||
32 | * @var StringScrambler |
||
33 | **/ |
||
34 | private $scrambler; |
||
35 | |||
36 | /** |
||
37 | * Variables to ignore |
||
38 | * |
||
39 | * @var string[] |
||
40 | **/ |
||
41 | private $ignore = array(); |
||
42 | |||
43 | /** |
||
44 | * Constructor |
||
45 | * |
||
46 | * @param StringScrambler $scrambler |
||
47 | * @return void |
||
|
|||
48 | **/ |
||
49 | public function __construct(StringScrambler $scrambler) |
||
53 | |||
54 | /** |
||
55 | * Scramble a property of a node |
||
56 | * |
||
57 | * @param Node $node |
||
58 | * @param string $var property to scramble |
||
59 | * @return Node |
||
60 | **/ |
||
61 | protected function scramble(Node $node, $var = 'name') |
||
90 | |||
91 | /** |
||
92 | * Scramble a string |
||
93 | * |
||
94 | * @param string $string |
||
95 | * @return string |
||
96 | **/ |
||
97 | protected function scrambleString($string) |
||
101 | |||
102 | /** |
||
103 | * Get the string scrambler |
||
104 | * |
||
105 | * @return StringScrambler |
||
106 | */ |
||
107 | public function getScrambler() |
||
111 | |||
112 | /** |
||
113 | * Set the string scrambler |
||
114 | * |
||
115 | * @param StringScrambler $scrambler |
||
116 | * @return RenameParameter |
||
117 | */ |
||
118 | public function setScrambler(StringScrambler $scrambler) |
||
124 | |||
125 | /** |
||
126 | * Get variables to ignore |
||
127 | * |
||
128 | * @return string[] |
||
129 | */ |
||
130 | public function getIgnore() |
||
134 | |||
135 | /** |
||
136 | * Set variables to ignore |
||
137 | * |
||
138 | * @param string[] $ignore |
||
139 | * @return parent |
||
140 | */ |
||
141 | public function setIgnore(array $ignore) |
||
147 | |||
148 | /** |
||
149 | * Add a variable name to ignore |
||
150 | * |
||
151 | * @param string|string[] $ignore |
||
152 | * @return RenameParameterVisitor |
||
153 | **/ |
||
154 | public function addIgnore($ignore) |
||
165 | } |
||
166 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.