@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | public function enterNode(Node $node) |
26 | 26 | { |
27 | - $callback = [$this, 'before' . ucfirst($node->getType())]; |
|
27 | + $callback = [$this, 'before'.ucfirst($node->getType())]; |
|
28 | 28 | if (is_callable($callback)) { |
29 | 29 | call_user_func_array($callback, [$node]); |
30 | 30 | } |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | |
33 | 33 | public function leaveNode(Node $node) |
34 | 34 | { |
35 | - if (! ($node instanceof ConstFetch)) |
|
35 | + if ( ! ($node instanceof ConstFetch)) |
|
36 | 36 | { |
37 | - $callback = [$this, 'rewrite' . ucfirst($node->getType())]; |
|
37 | + $callback = [$this, 'rewrite'.ucfirst($node->getType())]; |
|
38 | 38 | if (is_callable($callback)) { |
39 | 39 | call_user_func_array($callback, [$node]); |
40 | 40 | } |
@@ -47,23 +47,23 @@ discard block |
||
47 | 47 | return; |
48 | 48 | } |
49 | 49 | |
50 | - if (! ($node->name instanceof Name)) |
|
50 | + if ( ! ($node->name instanceof Name)) |
|
51 | 51 | { |
52 | 52 | return; |
53 | 53 | } |
54 | 54 | |
55 | - if (! $node->name->isUnqualified()) |
|
55 | + if ( ! $node->name->isUnqualified()) |
|
56 | 56 | { |
57 | 57 | return; |
58 | 58 | } |
59 | 59 | |
60 | - if (! ConstantPatcher::isBlacklisted((string) $node->name)) |
|
60 | + if ( ! ConstantPatcher::isBlacklisted((string) $node->name)) |
|
61 | 61 | { |
62 | - $replacement = new FullyQualified('\__ConstProxy__::get(\'' . (string) $node->name . '\')'); |
|
62 | + $replacement = new FullyQualified('\__ConstProxy__::get(\''.(string) $node->name.'\')'); |
|
63 | 63 | |
64 | 64 | $pos = $node->getAttribute('startTokenPos'); |
65 | 65 | ConstantPatcher::$replacement[$pos] = |
66 | - '\__ConstProxy__::get(\'' . (string) $node->name .'\')'; |
|
66 | + '\__ConstProxy__::get(\''.(string) $node->name.'\')'; |
|
67 | 67 | |
68 | 68 | $node->name = $replacement; |
69 | 69 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Kenjis\MonkeyPatch\Patcher; |
12 | 12 | |
13 | -require __DIR__ . '/../Exception/ExitException.php'; |
|
13 | +require __DIR__.'/../Exception/ExitException.php'; |
|
14 | 14 | |
15 | 15 | class ExitPatcher |
16 | 16 | { |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | } |
31 | 31 | elseif ($token[0] === T_EXIT) |
32 | 32 | { |
33 | - if ($tokens[$i+1] === ';') |
|
33 | + if ($tokens[$i + 1] === ';') |
|
34 | 34 | { |
35 | 35 | $new_source .= 'exit__()'; |
36 | 36 | } |
@@ -12,36 +12,36 @@ |
||
12 | 12 | if (class_exists('PhpParser\Autoloader')) { |
13 | 13 | if (class_exists('PhpParser\Node\Identifier')) { |
14 | 14 | // PHP-Parser 4.x |
15 | - require __DIR__ . '/4.x/MonkeyPatchManager.php'; |
|
15 | + require __DIR__.'/4.x/MonkeyPatchManager.php'; |
|
16 | 16 | } |
17 | - elseif (method_exists('PhpParser\Node\Name','set')) { |
|
17 | + elseif (method_exists('PhpParser\Node\Name', 'set')) { |
|
18 | 18 | // PHP-Parser 2.x |
19 | - require __DIR__ . '/2.x/MonkeyPatchManager.php'; |
|
19 | + require __DIR__.'/2.x/MonkeyPatchManager.php'; |
|
20 | 20 | } else { |
21 | 21 | // PHP-Parser 3.x |
22 | - require __DIR__ . '/3.x/MonkeyPatchManager.php'; |
|
22 | + require __DIR__.'/3.x/MonkeyPatchManager.php'; |
|
23 | 23 | } |
24 | 24 | } |
25 | 25 | // If you don't use Composer |
26 | 26 | else { |
27 | 27 | if (version_compare(PHP_VERSION, '5.5.0', '>=')) { |
28 | 28 | // Use PHP-Parser 3.x |
29 | - require __DIR__ . '/third_party/PHP-Parser-3.1.5/lib/bootstrap.php'; |
|
30 | - require __DIR__ . '/3.x/MonkeyPatchManager.php'; |
|
29 | + require __DIR__.'/third_party/PHP-Parser-3.1.5/lib/bootstrap.php'; |
|
30 | + require __DIR__.'/3.x/MonkeyPatchManager.php'; |
|
31 | 31 | } else { |
32 | 32 | // Use PHP-Parser 2.x |
33 | - require __DIR__ . '/third_party/PHP-Parser-2.1.1/lib/bootstrap.php'; |
|
34 | - require __DIR__ . '/2.x/MonkeyPatchManager.php'; |
|
33 | + require __DIR__.'/third_party/PHP-Parser-2.1.1/lib/bootstrap.php'; |
|
34 | + require __DIR__.'/2.x/MonkeyPatchManager.php'; |
|
35 | 35 | } |
36 | 36 | } |
37 | 37 | |
38 | -require __DIR__ . '/IncludeStream.php'; |
|
39 | -require __DIR__ . '/PathChecker.php'; |
|
40 | -require __DIR__ . '/MonkeyPatch.php'; |
|
41 | -require __DIR__ . '/Cache.php'; |
|
42 | -require __DIR__ . '/InvocationVerifier.php'; |
|
38 | +require __DIR__.'/IncludeStream.php'; |
|
39 | +require __DIR__.'/PathChecker.php'; |
|
40 | +require __DIR__.'/MonkeyPatch.php'; |
|
41 | +require __DIR__.'/Cache.php'; |
|
42 | +require __DIR__.'/InvocationVerifier.php'; |
|
43 | 43 | |
44 | -require __DIR__ . '/functions/exit__.php'; |
|
44 | +require __DIR__.'/functions/exit__.php'; |
|
45 | 45 | |
46 | 46 | const __GO_TO_ORIG__ = '__GO_TO_ORIG__'; |
47 | 47 |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * NOTE: If you change these, also change the error_reporting() code below |
55 | 55 | */ |
56 | 56 | // This `if` statemant is needed for @runInSeparateProcess |
57 | -if (! defined('ENVIRONMENT')) |
|
57 | +if ( ! defined('ENVIRONMENT')) |
|
58 | 58 | { |
59 | 59 | define('ENVIRONMENT', 'testing'); |
60 | 60 | } |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME)); |
233 | 233 | |
234 | 234 | // Path to the test directory containing all the test files. |
235 | - define('TESTPATH', __DIR__.DIRECTORY_SEPARATOR); // Should be the folder this `Bootstrap.php` file is in. |
|
235 | + define('TESTPATH', __DIR__.DIRECTORY_SEPARATOR); // Should be the folder this `Bootstrap.php` file is in. |
|
236 | 236 | |
237 | 237 | // Path to the system directory |
238 | 238 | define('BASEPATH', $system_path); |
@@ -314,9 +314,9 @@ discard block |
||
314 | 314 | define('VIEWPATH', $view_folder.DIRECTORY_SEPARATOR); |
315 | 315 | |
316 | 316 | // Path to the ci-phpunit-test directory |
317 | - if (is_file(TESTPATH . '_ci_phpunit_test' . DIRECTORY_SEPARATOR . 'CIPHPUnitTest.php')) |
|
317 | + if (is_file(TESTPATH.'_ci_phpunit_test'.DIRECTORY_SEPARATOR.'CIPHPUnitTest.php')) |
|
318 | 318 | { |
319 | - define('CI_PHPUNIT_TESTPATH', TESTPATH . '_ci_phpunit_test' . DIRECTORY_SEPARATOR); |
|
319 | + define('CI_PHPUNIT_TESTPATH', TESTPATH.'_ci_phpunit_test'.DIRECTORY_SEPARATOR); |
|
320 | 320 | } |
321 | 321 | else |
322 | 322 | { |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | * ------------------------------------------------------------------- |
378 | 378 | */ |
379 | 379 | |
380 | -require CI_PHPUNIT_TESTPATH . '/CIPHPUnitTest.php'; |
|
380 | +require CI_PHPUNIT_TESTPATH.'/CIPHPUnitTest.php'; |
|
381 | 381 | |
382 | 382 | CIPHPUnitTest::init(); |
383 | 383 | // Or you can set directories for autoloading |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | if ($this->db === null) |
37 | 37 | { |
38 | - $CI =& get_instance(); |
|
38 | + $CI = & get_instance(); |
|
39 | 39 | $CI->load->database(); |
40 | 40 | $this->db = $CI->db; |
41 | 41 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | { |
57 | 57 | $this->checkDbConnId(); |
58 | 58 | |
59 | - if (! empty($this->insertCache)) |
|
59 | + if ( ! empty($this->insertCache)) |
|
60 | 60 | { |
61 | 61 | foreach ($this->insertCache as $row) |
62 | 62 | { |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $this->db->close(); |
84 | 84 | $this->db = null; |
85 | 85 | |
86 | - $CI =& get_instance(); |
|
86 | + $CI = & get_instance(); |
|
87 | 87 | $CI->load->database(); |
88 | 88 | $this->db = $CI->db; |
89 | 89 | } |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public static function init(array $autoload_dirs = null) |
30 | 30 | { |
31 | - if (! defined('TESTPATH')) { |
|
31 | + if ( ! defined('TESTPATH')) { |
|
32 | 32 | define('TESTPATH', APPPATH.'tests'.DIRECTORY_SEPARATOR); |
33 | 33 | } |
34 | 34 | // Current Bootstrap.php should define this, but in case it doesn't: |
35 | - if (! defined('CI_PHPUNIT_TESTPATH')) { |
|
35 | + if ( ! defined('CI_PHPUNIT_TESTPATH')) { |
|
36 | 36 | define('CI_PHPUNIT_TESTPATH', dirname(__FILE__).DIRECTORY_SEPARATOR); |
37 | 37 | } |
38 | 38 | |
@@ -49,38 +49,38 @@ discard block |
||
49 | 49 | $cwd_backup = getcwd(); |
50 | 50 | |
51 | 51 | // Load autoloader for ci-phpunit-test |
52 | - require __DIR__ . '/autoloader.php'; |
|
52 | + require __DIR__.'/autoloader.php'; |
|
53 | 53 | |
54 | - require TESTPATH . 'TestCase.php'; |
|
54 | + require TESTPATH.'TestCase.php'; |
|
55 | 55 | |
56 | - $db_test_case_file = TESTPATH . 'DbTestCase.php'; |
|
56 | + $db_test_case_file = TESTPATH.'DbTestCase.php'; |
|
57 | 57 | if (is_readable($db_test_case_file)) |
58 | 58 | { |
59 | 59 | require $db_test_case_file; |
60 | 60 | } |
61 | 61 | |
62 | - $unit_test_case_file = TESTPATH . 'UnitTestCase.php'; |
|
62 | + $unit_test_case_file = TESTPATH.'UnitTestCase.php'; |
|
63 | 63 | if (is_readable($unit_test_case_file)) |
64 | 64 | { |
65 | 65 | require $unit_test_case_file; |
66 | 66 | } |
67 | 67 | |
68 | 68 | // Replace a few Common functions |
69 | - require __DIR__ . '/replacing/core/Common.php'; |
|
70 | - require BASEPATH . 'core/Common.php'; |
|
69 | + require __DIR__.'/replacing/core/Common.php'; |
|
70 | + require BASEPATH.'core/Common.php'; |
|
71 | 71 | |
72 | 72 | // Workaround for missing CodeIgniter's error handler |
73 | 73 | // See https://github.com/kenjis/ci-phpunit-test/issues/37 |
74 | 74 | set_error_handler('_error_handler'); |
75 | 75 | |
76 | 76 | // Load new functions of CIPHPUnitTest |
77 | - require __DIR__ . '/functions.php'; |
|
77 | + require __DIR__.'/functions.php'; |
|
78 | 78 | // Load ci-phpunit-test CI_Loader |
79 | - require __DIR__ . '/replacing/core/Loader.php'; |
|
79 | + require __DIR__.'/replacing/core/Loader.php'; |
|
80 | 80 | // Load ci-phpunit-test CI_Input |
81 | - require __DIR__ . '/replacing/core/Input.php'; |
|
81 | + require __DIR__.'/replacing/core/Input.php'; |
|
82 | 82 | // Load ci-phpunit-test CI_Output |
83 | - require __DIR__ . '/replacing/core/Output.php'; |
|
83 | + require __DIR__.'/replacing/core/Output.php'; |
|
84 | 84 | |
85 | 85 | // Change current directory |
86 | 86 | chdir(FCPATH); |
@@ -95,10 +95,10 @@ discard block |
||
95 | 95 | * |
96 | 96 | * And away we go... |
97 | 97 | */ |
98 | - require __DIR__ . '/replacing/core/CodeIgniter.php'; |
|
98 | + require __DIR__.'/replacing/core/CodeIgniter.php'; |
|
99 | 99 | |
100 | 100 | // Create CodeIgniter instance |
101 | - if (! self::wiredesignzHmvcInstalled()) |
|
101 | + if ( ! self::wiredesignzHmvcInstalled()) |
|
102 | 102 | { |
103 | 103 | new CI_Controller(); |
104 | 104 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | */ |
125 | 125 | public static function createCodeIgniterInstance($use_my_controller = false) |
126 | 126 | { |
127 | - if (! self::wiredesignzHmvcInstalled()) |
|
127 | + if ( ! self::wiredesignzHmvcInstalled()) |
|
128 | 128 | { |
129 | 129 | if ($use_my_controller && self::hasMyController()) |
130 | 130 | { |
@@ -149,11 +149,11 @@ discard block |
||
149 | 149 | } |
150 | 150 | |
151 | 151 | $my_controller_file = |
152 | - APPPATH . 'core/' . config_item('subclass_prefix') . 'Controller.php'; |
|
152 | + APPPATH.'core/'.config_item('subclass_prefix').'Controller.php'; |
|
153 | 153 | |
154 | 154 | if (file_exists($my_controller_file)) |
155 | 155 | { |
156 | - $controller_class = config_item('subclass_prefix') . 'Controller'; |
|
156 | + $controller_class = config_item('subclass_prefix').'Controller'; |
|
157 | 157 | if ( ! class_exists($controller_class)) |
158 | 158 | { |
159 | 159 | require $my_controller_file; |
@@ -185,11 +185,11 @@ discard block |
||
185 | 185 | protected static function replaceLoader() |
186 | 186 | { |
187 | 187 | $my_loader_file = |
188 | - APPPATH . 'core/' . config_item('subclass_prefix') . 'Loader.php'; |
|
188 | + APPPATH.'core/'.config_item('subclass_prefix').'Loader.php'; |
|
189 | 189 | |
190 | 190 | if (file_exists($my_loader_file)) |
191 | 191 | { |
192 | - self::$loader_class = config_item('subclass_prefix') . 'Loader'; |
|
192 | + self::$loader_class = config_item('subclass_prefix').'Loader'; |
|
193 | 193 | if ( ! class_exists(self::$loader_class)) |
194 | 194 | { |
195 | 195 | require $my_loader_file; |
@@ -200,11 +200,11 @@ discard block |
||
200 | 200 | protected static function replaceConfig() |
201 | 201 | { |
202 | 202 | $my_config_file = |
203 | - APPPATH . 'core/' . config_item('subclass_prefix') . 'Config.php'; |
|
203 | + APPPATH.'core/'.config_item('subclass_prefix').'Config.php'; |
|
204 | 204 | |
205 | 205 | if (file_exists($my_config_file)) |
206 | 206 | { |
207 | - self::$config_class = config_item('subclass_prefix') . 'Config'; |
|
207 | + self::$config_class = config_item('subclass_prefix').'Config'; |
|
208 | 208 | if ( ! class_exists(self::$config_class)) |
209 | 209 | { |
210 | 210 | require $my_config_file; |
@@ -223,19 +223,19 @@ discard block |
||
223 | 223 | |
224 | 224 | protected static function loadHelper($helper) |
225 | 225 | { |
226 | - $my_helper_file = APPPATH . 'helpers/' . config_item('subclass_prefix') . $helper . '.php'; |
|
226 | + $my_helper_file = APPPATH.'helpers/'.config_item('subclass_prefix').$helper.'.php'; |
|
227 | 227 | if (file_exists($my_helper_file)) |
228 | 228 | { |
229 | 229 | require $my_helper_file; |
230 | 230 | } |
231 | - require __DIR__ . '/replacing/helpers/' . $helper . '.php'; |
|
231 | + require __DIR__.'/replacing/helpers/'.$helper.'.php'; |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | public static function setPatcherCacheDir($dir = null) |
235 | 235 | { |
236 | 236 | if ($dir === null) |
237 | 237 | { |
238 | - $dir = CI_PHPUNIT_TESTPATH . 'tmp/cache'; |
|
238 | + $dir = CI_PHPUNIT_TESTPATH.'tmp/cache'; |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | MonkeyPatchManager::setCacheDir( |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | } |
251 | 251 | public static function loadConfig() |
252 | 252 | { |
253 | - $config= new self::$config_class; |
|
253 | + $config = new self::$config_class; |
|
254 | 254 | load_class_instance('Config', $config); |
255 | 255 | } |
256 | 256 | } |