@@ -36,17 +36,17 @@ discard block |
||
36 | 36 | { |
37 | 37 | public function leaveNode(Node $node) |
38 | 38 | { |
39 | - if (! ($node instanceof FuncCall)) |
|
39 | + if ( ! ($node instanceof FuncCall)) |
|
40 | 40 | { |
41 | 41 | return; |
42 | 42 | } |
43 | 43 | |
44 | - if (! ($node->name instanceof Name)) |
|
44 | + if ( ! ($node->name instanceof Name)) |
|
45 | 45 | { |
46 | 46 | return; |
47 | 47 | } |
48 | 48 | |
49 | - if (! $node->name->isUnqualified()) |
|
49 | + if ( ! $node->name->isUnqualified()) |
|
50 | 50 | { |
51 | 51 | return; |
52 | 52 | } |
@@ -57,12 +57,12 @@ discard block |
||
57 | 57 | ) { |
58 | 58 | $replacement = new FullyQualified(array()); |
59 | 59 | $replacement->set( |
60 | - '\__FuncProxy__::' . (string) $node->name |
|
60 | + '\__FuncProxy__::'.(string) $node->name |
|
61 | 61 | ); |
62 | 62 | |
63 | 63 | $pos = $node->getAttribute('startTokenPos'); |
64 | 64 | FunctionPatcher::$replacement[$pos] = |
65 | - '\__FuncProxy__::' . (string) $node->name; |
|
65 | + '\__FuncProxy__::'.(string) $node->name; |
|
66 | 66 | |
67 | 67 | $node->name = $replacement; |
68 | 68 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | self::outputMessage($msg); |
52 | 52 | throw new LogicException($msg); |
53 | 53 | } |
54 | - if (! FunctionPatcher::isWhitelisted($function)) |
|
54 | + if ( ! FunctionPatcher::isWhitelisted($function)) |
|
55 | 55 | { |
56 | 56 | $msg = "<red>Can't patch on '$function'. It is not in whitelist. If you want to patch it, please add it to 'functions_to_patch' in 'tests/Bootstrap.php'. But note that there are some limitations. See <https://github.com/kenjis/ci-phpunit-test/blob/master/docs/HowToWriteTests.md#patching-functions> for details.</red>"; |
57 | 57 | self::outputMessage($msg); |
@@ -97,16 +97,16 @@ discard block |
||
97 | 97 | $line = $info['line']; |
98 | 98 | $method = isset($info['class_method']) ? $info['class_method'] : $info['function']; |
99 | 99 | |
100 | - $log_args = function () use ($arguments) { |
|
100 | + $log_args = function() use ($arguments) { |
|
101 | 101 | $output = ''; |
102 | 102 | foreach ($arguments as $arg) { |
103 | - $output .= var_export($arg, true) . ', '; |
|
103 | + $output .= var_export($arg, true).', '; |
|
104 | 104 | } |
105 | 105 | $output = rtrim($output, ', '); |
106 | 106 | return $output; |
107 | 107 | }; |
108 | 108 | MonkeyPatchManager::log( |
109 | - 'invoke_func: ' . $function . '(' . $log_args() . ') on line ' . $line . ' in ' . $file . ' by ' . $method . '()' |
|
109 | + 'invoke_func: '.$function.'('.$log_args().') on line '.$line.' in '.$file.' by '.$method.'()' |
|
110 | 110 | ); |
111 | 111 | } |
112 | 112 | } |
@@ -148,10 +148,10 @@ discard block |
||
148 | 148 | |
149 | 149 | if (isset(self::$patches_to_apply[$function])) |
150 | 150 | { |
151 | - if (! self::checkCalledMethod($function)) |
|
151 | + if ( ! self::checkCalledMethod($function)) |
|
152 | 152 | { |
153 | 153 | MonkeyPatchManager::log( |
154 | - 'invoke_func: ' . $function . '() not patched (out of scope)' |
|
154 | + 'invoke_func: '.$function.'() not patched (out of scope)' |
|
155 | 155 | ); |
156 | 156 | self::checkPassedByReference($function); |
157 | 157 | return call_user_func_array($function, $arguments); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | |
161 | 161 | if (array_key_exists($function, self::$patches)) |
162 | 162 | { |
163 | - MonkeyPatchManager::log('invoke_func: ' . $function . '() patched'); |
|
163 | + MonkeyPatchManager::log('invoke_func: '.$function.'() patched'); |
|
164 | 164 | |
165 | 165 | if (is_callable(self::$patches[$function])) |
166 | 166 | { |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | } |
179 | 179 | |
180 | 180 | MonkeyPatchManager::log( |
181 | - 'invoke_func: ' . $function . '() not patched (no patch)' |
|
181 | + 'invoke_func: '.$function.'() not patched (no patch)' |
|
182 | 182 | ); |
183 | 183 | self::checkPassedByReference($function); |
184 | 184 | return call_user_func_array($function, $arguments); |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | $msg = str_replace( |
232 | 232 | ['<red>', '</red>'], [$red_begin, $red_end], $msg |
233 | 233 | ); |
234 | - echo $msg . "\n"; |
|
234 | + echo $msg."\n"; |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | /** |
@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Kenjis\MonkeyPatch\Patcher; |
12 | 12 | |
13 | -require __DIR__ . '/MethodPatcher/NodeVisitor.php'; |
|
14 | -require __DIR__ . '/MethodPatcher/PatchManager.php'; |
|
13 | +require __DIR__.'/MethodPatcher/NodeVisitor.php'; |
|
14 | +require __DIR__.'/MethodPatcher/PatchManager.php'; |
|
15 | 15 | |
16 | 16 | use LogicException; |
17 | 17 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | { |
56 | 56 | if ($start_method && $token === '{') |
57 | 57 | { |
58 | - $new_source .= '{ ' . self::CODE; |
|
58 | + $new_source .= '{ '.self::CODE; |
|
59 | 59 | $start_method = false; |
60 | 60 | $replacement = each(self::$replacement); |
61 | 61 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | { |
21 | 21 | public function leaveNode(Node $node) |
22 | 22 | { |
23 | - if (! ($node instanceof ClassMethod)) |
|
23 | + if ( ! ($node instanceof ClassMethod)) |
|
24 | 24 | { |
25 | 25 | return; |
26 | 26 | } |
@@ -66,16 +66,16 @@ |
||
66 | 66 | $called_method = 'n/a'; |
67 | 67 | } |
68 | 68 | |
69 | - $log_args = function () use ($params) { |
|
69 | + $log_args = function() use ($params) { |
|
70 | 70 | $output = ''; |
71 | 71 | foreach ($params as $arg) { |
72 | - $output .= var_export($arg, true) . ', '; |
|
72 | + $output .= var_export($arg, true).', '; |
|
73 | 73 | } |
74 | 74 | $output = rtrim($output, ', '); |
75 | 75 | return $output; |
76 | 76 | }; |
77 | 77 | MonkeyPatchManager::log( |
78 | - 'invoke_method: ' . $class.'::'.$method . '(' . $log_args() . ') on line ' . $line . ' in ' . $file . ' by ' . $called_method |
|
78 | + 'invoke_method: '.$class.'::'.$method.'('.$log_args().') on line '.$line.' in '.$file.' by '.$called_method |
|
79 | 79 | ); |
80 | 80 | // var_dump($trace); exit; |
81 | 81 | } |
@@ -30,11 +30,11 @@ |
||
30 | 30 | $real_path = realpath($path); |
31 | 31 | if ($real_path === FALSE) |
32 | 32 | { |
33 | - throw new RuntimeException($path . ' does not exist?'); |
|
33 | + throw new RuntimeException($path.' does not exist?'); |
|
34 | 34 | } |
35 | 35 | if (is_dir($real_path)) |
36 | 36 | { |
37 | - $real_path = $real_path . '/'; |
|
37 | + $real_path = $real_path.'/'; |
|
38 | 38 | } |
39 | 39 | $new_paths[] = $real_path; |
40 | 40 | } |
@@ -11,16 +11,16 @@ |
||
11 | 11 | // Autoloader for PHP-Parser |
12 | 12 | // Don't use `require`, because we must require it in CIPHPUnitTest::init() |
13 | 13 | // for providing autoloading when we don't use Monkey Patching |
14 | -require_once __DIR__ . '/third_party/PHP-Parser/lib/bootstrap.php'; |
|
14 | +require_once __DIR__.'/third_party/PHP-Parser/lib/bootstrap.php'; |
|
15 | 15 | |
16 | -require __DIR__ . '/IncludeStream.php'; |
|
17 | -require __DIR__ . '/PathChecker.php'; |
|
18 | -require __DIR__ . '/MonkeyPatchManager.php'; |
|
19 | -require __DIR__ . '/MonkeyPatch.php'; |
|
20 | -require __DIR__ . '/Cache.php'; |
|
21 | -require __DIR__ . '/InvocationVerifier.php'; |
|
16 | +require __DIR__.'/IncludeStream.php'; |
|
17 | +require __DIR__.'/PathChecker.php'; |
|
18 | +require __DIR__.'/MonkeyPatchManager.php'; |
|
19 | +require __DIR__.'/MonkeyPatch.php'; |
|
20 | +require __DIR__.'/Cache.php'; |
|
21 | +require __DIR__.'/InvocationVerifier.php'; |
|
22 | 22 | |
23 | -require __DIR__ . '/functions/exit__.php'; |
|
23 | +require __DIR__.'/functions/exit__.php'; |
|
24 | 24 | |
25 | 25 | const __GO_TO_ORIG__ = '__GO_TO_ORIG__'; |
26 | 26 |
@@ -18,11 +18,11 @@ |
||
18 | 18 | |
19 | 19 | if ($class === null) |
20 | 20 | { |
21 | - $message = 'exit() called in ' . $method . '() function'; |
|
21 | + $message = 'exit() called in '.$method.'() function'; |
|
22 | 22 | } |
23 | 23 | else |
24 | 24 | { |
25 | - $message = 'exit() called in ' . $class . '::' . $method . '()'; |
|
25 | + $message = 'exit() called in '.$class.'::'.$method.'()'; |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | $exception_name = Kenjis\MonkeyPatch\MonkeyPatchManager::getExitExceptionClassname(); |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | * Start the timer... tick tock tick tock... |
186 | 186 | * ------------------------------------------------------ |
187 | 187 | */ |
188 | - $BM =& load_class('Benchmark', 'core'); |
|
188 | + $BM = & load_class('Benchmark', 'core'); |
|
189 | 189 | $BM->mark('total_execution_time_start'); |
190 | 190 | $BM->mark('loading_time:_base_classes_start'); |
191 | 191 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | * Instantiate the hooks class |
195 | 195 | * ------------------------------------------------------ |
196 | 196 | */ |
197 | - $EXT =& load_class('Hooks', 'core'); |
|
197 | + $EXT = & load_class('Hooks', 'core'); |
|
198 | 198 | |
199 | 199 | /* |
200 | 200 | * ------------------------------------------------------ |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | * depending on another class that uses it. |
214 | 214 | * |
215 | 215 | */ |
216 | - $CFG =& load_class('Config', 'core'); |
|
216 | + $CFG = & load_class('Config', 'core'); |
|
217 | 217 | |
218 | 218 | // Do we have any manually set config items in the index.php file? |
219 | 219 | if (isset($assign_to_config) && is_array($assign_to_config)) |
@@ -291,28 +291,28 @@ discard block |
||
291 | 291 | * Instantiate the UTF-8 class |
292 | 292 | * ------------------------------------------------------ |
293 | 293 | */ |
294 | - $UNI =& load_class('Utf8', 'core'); |
|
294 | + $UNI = & load_class('Utf8', 'core'); |
|
295 | 295 | |
296 | 296 | /* |
297 | 297 | * ------------------------------------------------------ |
298 | 298 | * Instantiate the URI class |
299 | 299 | * ------------------------------------------------------ |
300 | 300 | */ |
301 | - $URI =& load_class('URI', 'core'); |
|
301 | + $URI = & load_class('URI', 'core'); |
|
302 | 302 | |
303 | 303 | /* |
304 | 304 | * ------------------------------------------------------ |
305 | 305 | * Instantiate the routing class and set the routing |
306 | 306 | * ------------------------------------------------------ |
307 | 307 | */ |
308 | - $RTR =& load_class('Router', 'core', isset($routing) ? $routing : NULL); |
|
308 | + $RTR = & load_class('Router', 'core', isset($routing) ? $routing : NULL); |
|
309 | 309 | |
310 | 310 | /* |
311 | 311 | * ------------------------------------------------------ |
312 | 312 | * Instantiate the output class |
313 | 313 | * ------------------------------------------------------ |
314 | 314 | */ |
315 | - $OUT =& load_class('Output', 'core'); |
|
315 | + $OUT = & load_class('Output', 'core'); |
|
316 | 316 | |
317 | 317 | /* |
318 | 318 | * ------------------------------------------------------ |
@@ -329,21 +329,21 @@ discard block |
||
329 | 329 | * Load the security class for xss and csrf support |
330 | 330 | * ----------------------------------------------------- |
331 | 331 | */ |
332 | - $SEC =& load_class('Security', 'core'); |
|
332 | + $SEC = & load_class('Security', 'core'); |
|
333 | 333 | |
334 | 334 | /* |
335 | 335 | * ------------------------------------------------------ |
336 | 336 | * Load the Input class and sanitize globals |
337 | 337 | * ------------------------------------------------------ |
338 | 338 | */ |
339 | - $IN =& load_class('Input', 'core'); |
|
339 | + $IN = & load_class('Input', 'core'); |
|
340 | 340 | |
341 | 341 | /* |
342 | 342 | * ------------------------------------------------------ |
343 | 343 | * Load the Language class |
344 | 344 | * ------------------------------------------------------ |
345 | 345 | */ |
346 | - $LANG =& load_class('Lang', 'core'); |
|
346 | + $LANG = & load_class('Lang', 'core'); |
|
347 | 347 | |
348 | 348 | /* |
349 | 349 | * ------------------------------------------------------ |