@@ -8,7 +8,7 @@ |
||
8 | 8 | * @link https://github.com/kenjis/ci-phpunit-test |
9 | 9 | */ |
10 | 10 | |
11 | -require __DIR__ . '/Installer.php'; |
|
11 | +require __DIR__.'/Installer.php'; |
|
12 | 12 | |
13 | 13 | $installer = new Installer(); |
14 | 14 | $installer->update(); |
@@ -12,7 +12,7 @@ |
||
12 | 12 | |
13 | 13 | $app = 'application'; |
14 | 14 | if ($argv && $argv[1] && is_dir($argv[1])) { |
15 | - $app = $argv[1]; |
|
15 | + $app = $argv[1]; |
|
16 | 16 | } |
17 | 17 | $installer = new Installer(); |
18 | 18 | $installer->update($app); |
@@ -38,8 +38,7 @@ |
||
38 | 38 | { |
39 | 39 | $patched = true; |
40 | 40 | $new_source = static::generateNewSource($source); |
41 | - } |
|
42 | - else |
|
41 | + } else |
|
43 | 42 | { |
44 | 43 | $new_source = $source; |
45 | 44 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | is_loaded('', TRUE); |
30 | 30 | |
31 | 31 | // Close db connection |
32 | - $CI =& get_instance(); |
|
32 | + $CI = & get_instance(); |
|
33 | 33 | if (isset($CI->db)) |
34 | 34 | { |
35 | 35 | if ( |
@@ -49,25 +49,25 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | // Load core classes |
52 | - $BM =& load_class('Benchmark', 'core'); |
|
52 | + $BM = & load_class('Benchmark', 'core'); |
|
53 | 53 | CIPHPUnitTestSuperGlobal::set_Global('BM', $BM); |
54 | - $EXT =& load_class('Hooks', 'core'); |
|
54 | + $EXT = & load_class('Hooks', 'core'); |
|
55 | 55 | CIPHPUnitTestSuperGlobal::set_Global('EXT', $EXT); |
56 | - $CFG =& load_class('Config', 'core'); |
|
56 | + $CFG = & load_class('Config', 'core'); |
|
57 | 57 | CIPHPUnitTestSuperGlobal::set_Global('CFG', $CFG); |
58 | - $UNI =& load_class('URI', 'core'); |
|
58 | + $UNI = & load_class('URI', 'core'); |
|
59 | 59 | CIPHPUnitTestSuperGlobal::set_Global('UNI', $UNI); |
60 | 60 | // $URI =& load_class('Utf8', 'core'); |
61 | 61 | // CIPHPUnitTestSuperGlobal::set_Global('URI', $URI); |
62 | - $RTR =& load_class('Router', 'core'); |
|
62 | + $RTR = & load_class('Router', 'core'); |
|
63 | 63 | CIPHPUnitTestSuperGlobal::set_Global('RTR', $RTR); |
64 | - $OUT =& load_class('Output', 'core'); |
|
64 | + $OUT = & load_class('Output', 'core'); |
|
65 | 65 | CIPHPUnitTestSuperGlobal::set_Global('OUT', $OUT); |
66 | - $SEC =& load_class('Security', 'core'); |
|
66 | + $SEC = & load_class('Security', 'core'); |
|
67 | 67 | CIPHPUnitTestSuperGlobal::set_Global('SEC', $SEC); |
68 | - $IN =& load_class('Input', 'core'); |
|
68 | + $IN = & load_class('Input', 'core'); |
|
69 | 69 | CIPHPUnitTestSuperGlobal::set_Global('IN', $IN); |
70 | - $LANG =& load_class('Lang', 'core'); |
|
70 | + $LANG = & load_class('Lang', 'core'); |
|
71 | 71 | CIPHPUnitTestSuperGlobal::set_Global('LANG', $LANG); |
72 | 72 | |
73 | 73 | CIPHPUnitTest::loadLoader(); |
@@ -8,7 +8,7 @@ |
||
8 | 8 | * @link https://github.com/kenjis/ci-phpunit-test |
9 | 9 | */ |
10 | 10 | |
11 | -require __DIR__ . '/Installer.php'; |
|
11 | +require __DIR__.'/Installer.php'; |
|
12 | 12 | |
13 | 13 | $installer = new Installer(); |
14 | 14 | $installer->update(); |
@@ -12,7 +12,7 @@ |
||
12 | 12 | |
13 | 13 | $app = 'application'; |
14 | 14 | if ($argv && $argv[1] && is_dir($argv[1])) { |
15 | - $app = $argv[1]; |
|
15 | + $app = $argv[1]; |
|
16 | 16 | } |
17 | 17 | $installer = new Installer(); |
18 | 18 | $installer->update($app); |
@@ -113,7 +113,7 @@ |
||
113 | 113 | */ |
114 | 114 | private static function checkConfigurationFile($file) |
115 | 115 | { |
116 | - if (!file_exists($file)) { |
|
116 | + if ( ! file_exists($file)) { |
|
117 | 117 | throw new \RuntimeException("The requested phpunit configuration was not found at $file"); |
118 | 118 | } |
119 | 119 |
@@ -52,71 +52,71 @@ |
||
52 | 52 | */ |
53 | 53 | final class TestSuiteProvider |
54 | 54 | { |
55 | - /** |
|
56 | - * phpunit configuration file |
|
57 | - * |
|
58 | - * @var string |
|
59 | - */ |
|
60 | - private static $file; |
|
55 | + /** |
|
56 | + * phpunit configuration file |
|
57 | + * |
|
58 | + * @var string |
|
59 | + */ |
|
60 | + private static $file; |
|
61 | 61 | |
62 | - /** |
|
63 | - * constructor |
|
64 | - */ |
|
65 | - private function __construct() {} |
|
62 | + /** |
|
63 | + * constructor |
|
64 | + */ |
|
65 | + private function __construct() {} |
|
66 | 66 | |
67 | - /** |
|
68 | - * set the phpunit configuration file |
|
69 | - * |
|
70 | - * @param string $file the path or filename of the phunit configuration file |
|
71 | - */ |
|
72 | - public static function setConfigurationFile($file) |
|
73 | - { |
|
74 | - static::$file = $file; |
|
75 | - } |
|
67 | + /** |
|
68 | + * set the phpunit configuration file |
|
69 | + * |
|
70 | + * @param string $file the path or filename of the phunit configuration file |
|
71 | + */ |
|
72 | + public static function setConfigurationFile($file) |
|
73 | + { |
|
74 | + static::$file = $file; |
|
75 | + } |
|
76 | 76 | |
77 | - /** |
|
78 | - * get the phpunit test suite instance |
|
79 | - * |
|
80 | - * @return PHPUnit_Framework_TestSuite returns the phpunit test suite instance |
|
81 | - * @throws FileNotFoundException if the file is not found |
|
82 | - */ |
|
83 | - public static function suite() |
|
84 | - { |
|
85 | - $file = static::checkConfigurationFile( |
|
86 | - static::getConfigurationFile() |
|
87 | - ); |
|
77 | + /** |
|
78 | + * get the phpunit test suite instance |
|
79 | + * |
|
80 | + * @return PHPUnit_Framework_TestSuite returns the phpunit test suite instance |
|
81 | + * @throws FileNotFoundException if the file is not found |
|
82 | + */ |
|
83 | + public static function suite() |
|
84 | + { |
|
85 | + $file = static::checkConfigurationFile( |
|
86 | + static::getConfigurationFile() |
|
87 | + ); |
|
88 | 88 | |
89 | - return PHPUnit_Util_Configuration::getInstance($file) |
|
90 | - ->getTestSuiteConfiguration(); |
|
91 | - } |
|
89 | + return PHPUnit_Util_Configuration::getInstance($file) |
|
90 | + ->getTestSuiteConfiguration(); |
|
91 | + } |
|
92 | 92 | |
93 | - /** |
|
94 | - * get the phpunit configuration file |
|
95 | - * |
|
96 | - * @return string |
|
97 | - */ |
|
98 | - private static function getConfigurationFile() |
|
99 | - { |
|
100 | - static::$file = isset(static::$file) |
|
101 | - ? static::$file |
|
102 | - : APPPATH.'tests/phpunit.xml'; |
|
93 | + /** |
|
94 | + * get the phpunit configuration file |
|
95 | + * |
|
96 | + * @return string |
|
97 | + */ |
|
98 | + private static function getConfigurationFile() |
|
99 | + { |
|
100 | + static::$file = isset(static::$file) |
|
101 | + ? static::$file |
|
102 | + : APPPATH.'tests/phpunit.xml'; |
|
103 | 103 | |
104 | - return static::$file; |
|
105 | - } |
|
104 | + return static::$file; |
|
105 | + } |
|
106 | 106 | |
107 | - /** |
|
108 | - * check the given file |
|
109 | - * |
|
110 | - * @param string $file file to check |
|
111 | - * @return string returns the file if it is valid |
|
112 | - * @throws FileNotFoundException if the file is not found |
|
113 | - */ |
|
114 | - private static function checkConfigurationFile($file) |
|
115 | - { |
|
116 | - if (!file_exists($file)) { |
|
117 | - throw new \RuntimeException("The requested phpunit configuration was not found at $file"); |
|
118 | - } |
|
107 | + /** |
|
108 | + * check the given file |
|
109 | + * |
|
110 | + * @param string $file file to check |
|
111 | + * @return string returns the file if it is valid |
|
112 | + * @throws FileNotFoundException if the file is not found |
|
113 | + */ |
|
114 | + private static function checkConfigurationFile($file) |
|
115 | + { |
|
116 | + if (!file_exists($file)) { |
|
117 | + throw new \RuntimeException("The requested phpunit configuration was not found at $file"); |
|
118 | + } |
|
119 | 119 | |
120 | - return $file; |
|
121 | - } |
|
120 | + return $file; |
|
121 | + } |
|
122 | 122 | } |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | /** |
234 | 234 | * Fetch an item from the GET array |
235 | 235 | * |
236 | - * @param mixed $index Index for item to be fetched from $_GET |
|
236 | + * @param string $index Index for item to be fetched from $_GET |
|
237 | 237 | * @param bool $xss_clean Whether to apply XSS filtering |
238 | 238 | * @return mixed |
239 | 239 | */ |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | /** |
248 | 248 | * Fetch an item from the POST array |
249 | 249 | * |
250 | - * @param mixed $index Index for item to be fetched from $_POST |
|
250 | + * @param string $index Index for item to be fetched from $_POST |
|
251 | 251 | * @param bool $xss_clean Whether to apply XSS filtering |
252 | 252 | * @return mixed |
253 | 253 | */ |
@@ -307,9 +307,9 @@ discard block |
||
307 | 307 | /** |
308 | 308 | * Fetch an item from the SERVER array |
309 | 309 | * |
310 | - * @param mixed $index Index for item to be fetched from $_SERVER |
|
310 | + * @param string $index Index for item to be fetched from $_SERVER |
|
311 | 311 | * @param bool $xss_clean Whether to apply XSS filtering |
312 | - * @return mixed |
|
312 | + * @return string |
|
313 | 313 | */ |
314 | 314 | public function server($index, $xss_clean = NULL) |
315 | 315 | { |
@@ -892,7 +892,7 @@ discard block |
||
892 | 892 | * Allows read access to protected properties |
893 | 893 | * |
894 | 894 | * @param string $name |
895 | - * @return mixed |
|
895 | + * @return string|null |
|
896 | 896 | */ |
897 | 897 | public function __get($name) |
898 | 898 | { |
@@ -137,17 +137,17 @@ discard block |
||
137 | 137 | */ |
138 | 138 | public function __construct() |
139 | 139 | { |
140 | - $this->_allow_get_array = (config_item('allow_get_array') === TRUE); |
|
141 | - $this->_enable_xss = (config_item('global_xss_filtering') === TRUE); |
|
142 | - $this->_enable_csrf = (config_item('csrf_protection') === TRUE); |
|
143 | - $this->_standardize_newlines = (bool) config_item('standardize_newlines'); |
|
140 | + $this->_allow_get_array = (config_item('allow_get_array') === TRUE); |
|
141 | + $this->_enable_xss = (config_item('global_xss_filtering') === TRUE); |
|
142 | + $this->_enable_csrf = (config_item('csrf_protection') === TRUE); |
|
143 | + $this->_standardize_newlines = (bool) config_item('standardize_newlines'); |
|
144 | 144 | |
145 | - $this->security =& load_class('Security', 'core'); |
|
145 | + $this->security = & load_class('Security', 'core'); |
|
146 | 146 | |
147 | 147 | // Do we need the UTF-8 class? |
148 | 148 | if (UTF8_ENABLED === TRUE) |
149 | 149 | { |
150 | - $this->uni =& load_class('Utf8', 'core'); |
|
150 | + $this->uni = & load_class('Utf8', 'core'); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | // Sanitize global arrays |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | |
414 | 414 | // Save cookie in Output object |
415 | 415 | // added by ci-phpunit-test |
416 | - $CI =& get_instance(); |
|
416 | + $CI = & get_instance(); |
|
417 | 417 | $output = $CI->output; |
418 | 418 | $output->_cookies[$prefix.$name][] = [ |
419 | 419 | 'value' => $value, |
@@ -196,29 +196,30 @@ discard block |
||
196 | 196 | if (isset($array[$index])) |
197 | 197 | { |
198 | 198 | $value = $array[$index]; |
199 | - } |
|
200 | - elseif (($count = preg_match_all('/(?:^[^\[]+)|\[[^]]*\]/', $index, $matches)) > 1) // Does the index contain array notation |
|
199 | + } elseif (($count = preg_match_all('/(?:^[^\[]+)|\[[^]]*\]/', $index, $matches)) > 1) { |
|
200 | + // Does the index contain array notation |
|
201 | 201 | { |
202 | 202 | $value = $array; |
203 | + } |
|
203 | 204 | for ($i = 0; $i < $count; $i++) |
204 | 205 | { |
205 | 206 | $key = trim($matches[0][$i], '[]'); |
206 | - if ($key === '') // Empty notation will return the value as array |
|
207 | + if ($key === '') { |
|
208 | + // Empty notation will return the value as array |
|
207 | 209 | { |
208 | 210 | break; |
209 | 211 | } |
212 | + } |
|
210 | 213 | |
211 | 214 | if (isset($value[$key])) |
212 | 215 | { |
213 | 216 | $value = $value[$key]; |
214 | - } |
|
215 | - else |
|
217 | + } else |
|
216 | 218 | { |
217 | 219 | return NULL; |
218 | 220 | } |
219 | 221 | } |
220 | - } |
|
221 | - else |
|
222 | + } else |
|
222 | 223 | { |
223 | 224 | return NULL; |
224 | 225 | } |
@@ -403,8 +404,7 @@ discard block |
||
403 | 404 | if ( ! is_numeric($expire)) |
404 | 405 | { |
405 | 406 | $expire = time() - 86500; |
406 | - } |
|
407 | - else |
|
407 | + } else |
|
408 | 408 | { |
409 | 409 | $expire = ($expire > 0) ? time() + $expire : 0; |
410 | 410 | } |
@@ -463,8 +463,7 @@ discard block |
||
463 | 463 | if ( ! $this->valid_ip($spoof)) |
464 | 464 | { |
465 | 465 | $spoof = NULL; |
466 | - } |
|
467 | - else |
|
466 | + } else |
|
468 | 467 | { |
469 | 468 | break; |
470 | 469 | } |
@@ -517,8 +516,7 @@ discard block |
||
517 | 516 | } |
518 | 517 | |
519 | 518 | $sprintf = '%016b%016b%016b%016b%016b%016b%016b%016b'; |
520 | - } |
|
521 | - else |
|
519 | + } else |
|
522 | 520 | { |
523 | 521 | $ip = explode('.', $this->ip_address); |
524 | 522 | $sprintf = '%08b%08b%08b%08b'; |
@@ -538,8 +536,7 @@ discard block |
||
538 | 536 | { |
539 | 537 | $netaddr[$i] = intval($netaddr[$j], 16); |
540 | 538 | } |
541 | - } |
|
542 | - else |
|
539 | + } else |
|
543 | 540 | { |
544 | 541 | $netaddr = explode('.', $netaddr); |
545 | 542 | } |
@@ -620,8 +617,7 @@ discard block |
||
620 | 617 | if ($this->_allow_get_array === FALSE) |
621 | 618 | { |
622 | 619 | $_GET = array(); |
623 | - } |
|
624 | - elseif (is_array($_GET)) |
|
620 | + } elseif (is_array($_GET)) |
|
625 | 621 | { |
626 | 622 | foreach ($_GET as $key => $val) |
627 | 623 | { |
@@ -657,8 +653,7 @@ discard block |
||
657 | 653 | if (($cookie_key = $this->_clean_input_keys($key)) !== FALSE) |
658 | 654 | { |
659 | 655 | $_COOKIE[$cookie_key] = $this->_clean_input_data($val); |
660 | - } |
|
661 | - else |
|
656 | + } else |
|
662 | 657 | { |
663 | 658 | unset($_COOKIE[$key]); |
664 | 659 | } |
@@ -744,8 +739,7 @@ discard block |
||
744 | 739 | if ($fatal === TRUE) |
745 | 740 | { |
746 | 741 | return FALSE; |
747 | - } |
|
748 | - else |
|
742 | + } else |
|
749 | 743 | { |
750 | 744 | set_status_header(503); |
751 | 745 | echo 'Disallowed Key Characters.'; |
@@ -782,8 +776,7 @@ discard block |
||
782 | 776 | if (function_exists('apache_request_headers')) |
783 | 777 | { |
784 | 778 | $this->headers = apache_request_headers(); |
785 | - } |
|
786 | - else |
|
779 | + } else |
|
787 | 780 | { |
788 | 781 | isset($_SERVER['CONTENT_TYPE']) && $this->headers['Content-Type'] = $_SERVER['CONTENT_TYPE']; |
789 | 782 | |
@@ -904,8 +897,7 @@ discard block |
||
904 | 897 | { |
905 | 898 | isset($this->_raw_input_stream) OR $this->_raw_input_stream = file_get_contents('php://input'); |
906 | 899 | return $this->_raw_input_stream; |
907 | - } |
|
908 | - elseif ($name === 'ip_address') |
|
900 | + } elseif ($name === 'ip_address') |
|
909 | 901 | { |
910 | 902 | return $this->ip_address; |
911 | 903 | } |
@@ -47,8 +47,7 @@ discard block |
||
47 | 47 | ? $backtrace[$offset+2]['class'] |
48 | 48 | : null; |
49 | 49 | $function = $backtrace[$offset+2]['function']; |
50 | - } |
|
51 | - else |
|
50 | + } else |
|
52 | 51 | { |
53 | 52 | $class = null; |
54 | 53 | $function = null; |
@@ -59,8 +58,7 @@ discard block |
||
59 | 58 | $method = $function; |
60 | 59 | $class_method = $class . '::' . $function; |
61 | 60 | $function = null; |
62 | - } |
|
63 | - else |
|
61 | + } else |
|
64 | 62 | { |
65 | 63 | $method = null; |
66 | 64 | $class_method = null; |
@@ -33,35 +33,35 @@ discard block |
||
33 | 33 | $cwd_backup = getcwd(); |
34 | 34 | |
35 | 35 | // Load autoloader for ci-phpunit-test |
36 | - require __DIR__ . '/autoloader.php'; |
|
36 | + require __DIR__.'/autoloader.php'; |
|
37 | 37 | |
38 | 38 | // Autoloader for PHP-Parser |
39 | 39 | // Don't use `require`, because we may have required already |
40 | 40 | // in `patcher/bootstrap.php` |
41 | - require_once __DIR__ . '/patcher/third_party/PHP-Parser/lib/bootstrap.php'; |
|
41 | + require_once __DIR__.'/patcher/third_party/PHP-Parser/lib/bootstrap.php'; |
|
42 | 42 | |
43 | - require APPPATH . '/tests/TestCase.php'; |
|
43 | + require APPPATH.'/tests/TestCase.php'; |
|
44 | 44 | |
45 | - $db_test_case_file = APPPATH . '/tests/DbTestCase.php'; |
|
45 | + $db_test_case_file = APPPATH.'/tests/DbTestCase.php'; |
|
46 | 46 | if (is_readable($db_test_case_file)) |
47 | 47 | { |
48 | 48 | require $db_test_case_file; |
49 | 49 | } |
50 | 50 | |
51 | 51 | // Replace a few Common functions |
52 | - require __DIR__ . '/replacing/core/Common.php'; |
|
53 | - require BASEPATH . 'core/Common.php'; |
|
52 | + require __DIR__.'/replacing/core/Common.php'; |
|
53 | + require BASEPATH.'core/Common.php'; |
|
54 | 54 | |
55 | 55 | // Workaround for missing CodeIgniter's error handler |
56 | 56 | // See https://github.com/kenjis/ci-phpunit-test/issues/37 |
57 | 57 | set_error_handler('_error_handler'); |
58 | 58 | |
59 | 59 | // Load new functions of CIPHPUnitTest |
60 | - require __DIR__ . '/functions.php'; |
|
60 | + require __DIR__.'/functions.php'; |
|
61 | 61 | // Load ci-phpunit-test CI_Loader |
62 | - require __DIR__ . '/replacing/core/Loader.php'; |
|
62 | + require __DIR__.'/replacing/core/Loader.php'; |
|
63 | 63 | // Load ci-phpunit-test CI_Input |
64 | - require __DIR__ . '/replacing/core/Input.php'; |
|
64 | + require __DIR__.'/replacing/core/Input.php'; |
|
65 | 65 | |
66 | 66 | // Change current directroy |
67 | 67 | chdir(FCPATH); |
@@ -73,12 +73,12 @@ discard block |
||
73 | 73 | * |
74 | 74 | * And away we go... |
75 | 75 | */ |
76 | - require __DIR__ . '/replacing/core/CodeIgniter.php'; |
|
76 | + require __DIR__.'/replacing/core/CodeIgniter.php'; |
|
77 | 77 | |
78 | 78 | self::replaceHelpers(); |
79 | 79 | |
80 | 80 | // Create CodeIgniter instance |
81 | - if (! self::wiredesignzHmvcInstalled()) |
|
81 | + if ( ! self::wiredesignzHmvcInstalled()) |
|
82 | 82 | { |
83 | 83 | new CI_Controller(); |
84 | 84 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | public static function createCodeIgniterInstance() |
101 | 101 | { |
102 | - if (! self::wiredesignzHmvcInstalled()) |
|
102 | + if ( ! self::wiredesignzHmvcInstalled()) |
|
103 | 103 | { |
104 | 104 | new CI_Controller(); |
105 | 105 | } |
@@ -128,11 +128,11 @@ discard block |
||
128 | 128 | protected static function replaceLoader() |
129 | 129 | { |
130 | 130 | $my_loader_file = |
131 | - APPPATH . 'core/' . config_item('subclass_prefix') . 'Loader.php'; |
|
131 | + APPPATH.'core/'.config_item('subclass_prefix').'Loader.php'; |
|
132 | 132 | |
133 | 133 | if (file_exists($my_loader_file)) |
134 | 134 | { |
135 | - self::$loader_class = config_item('subclass_prefix') . 'Loader'; |
|
135 | + self::$loader_class = config_item('subclass_prefix').'Loader'; |
|
136 | 136 | if ( ! class_exists(self::$loader_class)) |
137 | 137 | { |
138 | 138 | require $my_loader_file; |
@@ -143,19 +143,19 @@ discard block |
||
143 | 143 | |
144 | 144 | protected static function replaceHelpers() |
145 | 145 | { |
146 | - $my_helper_file = APPPATH . 'helpers/' . config_item('subclass_prefix') . 'url_helper.php'; |
|
146 | + $my_helper_file = APPPATH.'helpers/'.config_item('subclass_prefix').'url_helper.php'; |
|
147 | 147 | if (file_exists($my_helper_file)) |
148 | 148 | { |
149 | 149 | require $my_helper_file; |
150 | 150 | } |
151 | - require __DIR__ . '/replacing/helpers/url_helper.php'; |
|
151 | + require __DIR__.'/replacing/helpers/url_helper.php'; |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | public static function setPatcherCacheDir($dir = null) |
155 | 155 | { |
156 | 156 | if ($dir === null) |
157 | 157 | { |
158 | - $dir = APPPATH . 'tests/_ci_phpunit_test/tmp/cache'; |
|
158 | + $dir = APPPATH.'tests/_ci_phpunit_test/tmp/cache'; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | MonkeyPatchManager::setCacheDir( |
@@ -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 | CIPHPUnitTestSuperGlobal::set_Global('BM', $BM); |
190 | 190 | $BM->mark('total_execution_time_start'); |
191 | 191 | $BM->mark('loading_time:_base_classes_start'); |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | * Instantiate the hooks class |
196 | 196 | * ------------------------------------------------------ |
197 | 197 | */ |
198 | - $EXT =& load_class('Hooks', 'core'); |
|
198 | + $EXT = & load_class('Hooks', 'core'); |
|
199 | 199 | CIPHPUnitTestSuperGlobal::set_Global('EXT', $EXT); |
200 | 200 | |
201 | 201 | /* |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | * depending on another class that uses it. |
216 | 216 | * |
217 | 217 | */ |
218 | - $CFG =& load_class('Config', 'core'); |
|
218 | + $CFG = & load_class('Config', 'core'); |
|
219 | 219 | CIPHPUnitTestSuperGlobal::set_Global('CFG', $CFG); |
220 | 220 | |
221 | 221 | // Do we have any manually set config items in the index.php file? |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | * Instantiate the UTF-8 class |
295 | 295 | * ------------------------------------------------------ |
296 | 296 | */ |
297 | - $UNI =& load_class('Utf8', 'core'); |
|
297 | + $UNI = & load_class('Utf8', 'core'); |
|
298 | 298 | CIPHPUnitTestSuperGlobal::set_Global('UNI', $UNI); |
299 | 299 | |
300 | 300 | /* |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | * Instantiate the URI class |
303 | 303 | * ------------------------------------------------------ |
304 | 304 | */ |
305 | - $URI =& load_class('URI', 'core'); |
|
305 | + $URI = & load_class('URI', 'core'); |
|
306 | 306 | CIPHPUnitTestSuperGlobal::set_Global('URI', $URI); |
307 | 307 | |
308 | 308 | /* |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | * Instantiate the routing class and set the routing |
311 | 311 | * ------------------------------------------------------ |
312 | 312 | */ |
313 | - $RTR =& load_class('Router', 'core', isset($routing) ? $routing : NULL); |
|
313 | + $RTR = & load_class('Router', 'core', isset($routing) ? $routing : NULL); |
|
314 | 314 | CIPHPUnitTestSuperGlobal::set_Global('RTR', $RTR); |
315 | 315 | |
316 | 316 | /* |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | * Instantiate the output class |
319 | 319 | * ------------------------------------------------------ |
320 | 320 | */ |
321 | - $OUT =& load_class('Output', 'core'); |
|
321 | + $OUT = & load_class('Output', 'core'); |
|
322 | 322 | CIPHPUnitTestSuperGlobal::set_Global('OUT', $OUT); |
323 | 323 | |
324 | 324 | /* |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | * Load the security class for xss and csrf support |
337 | 337 | * ----------------------------------------------------- |
338 | 338 | */ |
339 | - $SEC =& load_class('Security', 'core'); |
|
339 | + $SEC = & load_class('Security', 'core'); |
|
340 | 340 | CIPHPUnitTestSuperGlobal::set_Global('SEC', $SEC); |
341 | 341 | |
342 | 342 | /* |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | * Load the Input class and sanitize globals |
345 | 345 | * ------------------------------------------------------ |
346 | 346 | */ |
347 | - $IN =& load_class('Input', 'core'); |
|
347 | + $IN = & load_class('Input', 'core'); |
|
348 | 348 | CIPHPUnitTestSuperGlobal::set_Global('IN', $IN); |
349 | 349 | |
350 | 350 | /* |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | * Load the Language class |
353 | 353 | * ------------------------------------------------------ |
354 | 354 | */ |
355 | - $LANG =& load_class('Lang', 'core'); |
|
355 | + $LANG = & load_class('Lang', 'core'); |
|
356 | 356 | CIPHPUnitTestSuperGlobal::set_Global('LANG', $LANG); |
357 | 357 | |
358 | 358 | /* |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | */ |
376 | 376 | function &get_instance() |
377 | 377 | { |
378 | - if (! CIPHPUnitTest::wiredesignzHmvcInstalled()) |
|
378 | + if ( ! CIPHPUnitTest::wiredesignzHmvcInstalled()) |
|
379 | 379 | { |
380 | 380 | return CI_Controller::get_instance(); |
381 | 381 | } |
@@ -169,12 +169,10 @@ discard block |
||
169 | 169 | file_exists(APPPATH.'vendor/autoload.php') |
170 | 170 | ? require_once(APPPATH.'vendor/autoload.php') |
171 | 171 | : log_message('error', '$config[\'composer_autoload\'] is set to TRUE but '.APPPATH.'vendor/autoload.php was not found.'); |
172 | - } |
|
173 | - elseif (file_exists($composer_autoload)) |
|
172 | + } elseif (file_exists($composer_autoload)) |
|
174 | 173 | { |
175 | 174 | require_once($composer_autoload); |
176 | - } |
|
177 | - else |
|
175 | + } else |
|
178 | 176 | { |
179 | 177 | log_message('error', 'Could not find the specified $config[\'composer_autoload\'] path: '.$composer_autoload); |
180 | 178 | } |
@@ -253,8 +251,7 @@ discard block |
||
253 | 251 | // This is required for mb_convert_encoding() to strip invalid characters. |
254 | 252 | // That's utilized by CI_Utf8, but it's also done for consistency with iconv. |
255 | 253 | mb_substitute_character('none'); |
256 | - } |
|
257 | - else |
|
254 | + } else |
|
258 | 255 | { |
259 | 256 | define('MB_ENABLED', FALSE); |
260 | 257 | } |
@@ -267,8 +264,7 @@ discard block |
||
267 | 264 | // iconv.internal_encoding is deprecated starting with PHP 5.6 |
268 | 265 | // and it's usage triggers E_DEPRECATED messages. |
269 | 266 | @ini_set('iconv.internal_encoding', $charset); |
270 | - } |
|
271 | - else |
|
267 | + } else |
|
272 | 268 | { |
273 | 269 | define('ICONV_ENABLED', FALSE); |
274 | 270 | } |
@@ -378,8 +374,7 @@ discard block |
||
378 | 374 | if (! CIPHPUnitTest::wiredesignzHmvcInstalled()) |
379 | 375 | { |
380 | 376 | return CI_Controller::get_instance(); |
381 | - } |
|
382 | - else |
|
377 | + } else |
|
383 | 378 | { |
384 | 379 | return CI::$APP; |
385 | 380 | } |
@@ -424,16 +419,14 @@ discard block |
||
424 | 419 | if (empty($class) OR ! file_exists(APPPATH.'controllers/'.$RTR->directory.$class.'.php')) |
425 | 420 | { |
426 | 421 | $e404 = TRUE; |
427 | - } |
|
428 | - else |
|
422 | + } else |
|
429 | 423 | { |
430 | 424 | require_once(APPPATH.'controllers/'.$RTR->directory.$class.'.php'); |
431 | 425 | |
432 | 426 | if ( ! class_exists($class, FALSE) OR $method[0] === '_' OR method_exists('CI_Controller', $method)) |
433 | 427 | { |
434 | 428 | $e404 = TRUE; |
435 | - } |
|
436 | - elseif (method_exists($class, '_remap')) |
|
429 | + } elseif (method_exists($class, '_remap')) |
|
437 | 430 | { |
438 | 431 | $params = array($method, array_slice($URI->rsegments, 2)); |
439 | 432 | $method = '_remap'; |
@@ -475,8 +468,7 @@ discard block |
||
475 | 468 | $RTR->directory = ''; |
476 | 469 | } |
477 | 470 | } |
478 | - } |
|
479 | - else |
|
471 | + } else |
|
480 | 472 | { |
481 | 473 | $e404 = FALSE; |
482 | 474 | } |
@@ -492,8 +484,7 @@ discard block |
||
492 | 484 | 1 => $class, |
493 | 485 | 2 => $method |
494 | 486 | ); |
495 | - } |
|
496 | - else |
|
487 | + } else |
|
497 | 488 | { |
498 | 489 | show_404($RTR->directory.$class.'/'.$method); |
499 | 490 | } |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | public static function install($app = 'application') |
16 | 16 | { |
17 | 17 | self::recursiveCopy( |
18 | - dirname(__FILE__) . '/application/tests', |
|
19 | - $app . '/' . static::TEST_FOLDER |
|
18 | + dirname(__FILE__).'/application/tests', |
|
19 | + $app.'/'.static::TEST_FOLDER |
|
20 | 20 | ); |
21 | 21 | self::fixPath($app); |
22 | 22 | } |
@@ -26,10 +26,10 @@ discard block |
||
26 | 26 | */ |
27 | 27 | private static function fixPath($app = 'application') |
28 | 28 | { |
29 | - $file = $app . '/' . static::TEST_FOLDER . '/Bootstrap.php'; |
|
29 | + $file = $app.'/'.static::TEST_FOLDER.'/Bootstrap.php'; |
|
30 | 30 | $contents = file_get_contents($file); |
31 | 31 | |
32 | - if (! file_exists('system')) { |
|
32 | + if ( ! file_exists('system')) { |
|
33 | 33 | if (file_exists('vendor/codeigniter/framework/system')) { |
34 | 34 | $contents = str_replace( |
35 | 35 | '$system_path = \'../../system\';', |
@@ -41,14 +41,14 @@ discard block |
||
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
44 | - if (! file_exists('index.php')) { |
|
44 | + if ( ! file_exists('index.php')) { |
|
45 | 45 | if (file_exists('public/index.php')) { |
46 | 46 | $contents = str_replace( |
47 | 47 | "define('FCPATH', realpath(dirname(__FILE__).'/../..').'/');", |
48 | 48 | "define('FCPATH', realpath(dirname(__FILE__).'/../../public').'/');", |
49 | 49 | $contents |
50 | 50 | ); |
51 | - } elseif (file_exists($app . '/public/index.php')) { |
|
51 | + } elseif (file_exists($app.'/public/index.php')) { |
|
52 | 52 | $contents = str_replace( |
53 | 53 | "define('FCPATH', realpath(dirname(__FILE__).'/../..').'/');", |
54 | 54 | "define('FCPATH', realpath(dirname(__FILE__).'/../public').'/');", |
@@ -71,10 +71,10 @@ discard block |
||
71 | 71 | |
72 | 72 | public static function update($app = 'application') |
73 | 73 | { |
74 | - $target_dir = $app . '/' . static::TEST_FOLDER . '/_ci_phpunit_test'; |
|
74 | + $target_dir = $app.'/'.static::TEST_FOLDER.'/_ci_phpunit_test'; |
|
75 | 75 | self::recursiveUnlink($target_dir); |
76 | 76 | self::recursiveCopy( |
77 | - dirname(__FILE__) . '/application/tests/_ci_phpunit_test', |
|
77 | + dirname(__FILE__).'/application/tests/_ci_phpunit_test', |
|
78 | 78 | $target_dir |
79 | 79 | ); |
80 | 80 | } |
@@ -96,11 +96,11 @@ discard block |
||
96 | 96 | |
97 | 97 | foreach ($iterator as $file) { |
98 | 98 | if ($file->isDir()) { |
99 | - @mkdir($dst . '/' . $iterator->getSubPathName()); |
|
99 | + @mkdir($dst.'/'.$iterator->getSubPathName()); |
|
100 | 100 | } else { |
101 | - $success = copy($file, $dst . '/' . $iterator->getSubPathName()); |
|
101 | + $success = copy($file, $dst.'/'.$iterator->getSubPathName()); |
|
102 | 102 | if ($success) { |
103 | - echo 'copied: ' . $dst . '/' . $iterator->getSubPathName() . PHP_EOL; |
|
103 | + echo 'copied: '.$dst.'/'.$iterator->getSubPathName().PHP_EOL; |
|
104 | 104 | } |
105 | 105 | } |
106 | 106 | } |
@@ -10,136 +10,136 @@ |
||
10 | 10 | |
11 | 11 | class Installer |
12 | 12 | { |
13 | - const TEST_FOLDER = 'tests'; |
|
13 | + const TEST_FOLDER = 'tests'; |
|
14 | 14 | |
15 | - public static function install($app = 'application') |
|
16 | - { |
|
17 | - self::recursiveCopy( |
|
18 | - dirname(__FILE__) . '/application/tests', |
|
19 | - $app . '/' . static::TEST_FOLDER |
|
20 | - ); |
|
21 | - self::fixPath($app); |
|
22 | - } |
|
15 | + public static function install($app = 'application') |
|
16 | + { |
|
17 | + self::recursiveCopy( |
|
18 | + dirname(__FILE__) . '/application/tests', |
|
19 | + $app . '/' . static::TEST_FOLDER |
|
20 | + ); |
|
21 | + self::fixPath($app); |
|
22 | + } |
|
23 | 23 | |
24 | - /** |
|
25 | - * Fix paths in Bootstrap.php |
|
26 | - */ |
|
27 | - private static function fixPath($app = 'application') |
|
28 | - { |
|
29 | - $file = $app . '/' . static::TEST_FOLDER . '/Bootstrap.php'; |
|
30 | - $contents = file_get_contents($file); |
|
24 | + /** |
|
25 | + * Fix paths in Bootstrap.php |
|
26 | + */ |
|
27 | + private static function fixPath($app = 'application') |
|
28 | + { |
|
29 | + $file = $app . '/' . static::TEST_FOLDER . '/Bootstrap.php'; |
|
30 | + $contents = file_get_contents($file); |
|
31 | 31 | |
32 | - if (! file_exists('system')) { |
|
33 | - if (file_exists('vendor/codeigniter/framework/system')) { |
|
34 | - $contents = str_replace( |
|
35 | - '$system_path = \'../../system\';', |
|
36 | - '$system_path = \'../../vendor/codeigniter/framework/system\';', |
|
37 | - $contents |
|
38 | - ); |
|
39 | - } else { |
|
40 | - throw new Exception('Can\'t find "system" folder.'); |
|
41 | - } |
|
42 | - } |
|
32 | + if (! file_exists('system')) { |
|
33 | + if (file_exists('vendor/codeigniter/framework/system')) { |
|
34 | + $contents = str_replace( |
|
35 | + '$system_path = \'../../system\';', |
|
36 | + '$system_path = \'../../vendor/codeigniter/framework/system\';', |
|
37 | + $contents |
|
38 | + ); |
|
39 | + } else { |
|
40 | + throw new Exception('Can\'t find "system" folder.'); |
|
41 | + } |
|
42 | + } |
|
43 | 43 | |
44 | - if (! file_exists('index.php')) { |
|
45 | - if (file_exists('public/index.php')) { |
|
46 | - // CodeIgniter 3.0.6 and after |
|
47 | - $contents = str_replace( |
|
48 | - "define('FCPATH', realpath(dirname(__FILE__).'/../..').DIRECTORY_SEPARATOR);", |
|
49 | - "define('FCPATH', realpath(dirname(__FILE__).'/../../public').DIRECTORY_SEPARATOR);", |
|
50 | - $contents |
|
51 | - ); |
|
52 | - // CodeIgniter 3.0.5 and before |
|
53 | - $contents = str_replace( |
|
54 | - "define('FCPATH', realpath(dirname(__FILE__).'/../..').'/');", |
|
55 | - "define('FCPATH', realpath(dirname(__FILE__).'/../../public').'/');", |
|
56 | - $contents |
|
57 | - ); |
|
58 | - } elseif (file_exists($app . '/public/index.php')) { |
|
59 | - // CodeIgniter 3.0.6 and after |
|
60 | - $contents = str_replace( |
|
61 | - "define('FCPATH', realpath(dirname(__FILE__).'/../..').DIRECTORY_SEPARATOR);", |
|
62 | - "define('FCPATH', realpath(dirname(__FILE__).'/../public').DIRECTORY_SEPARATOR);", |
|
63 | - $contents |
|
64 | - ); |
|
65 | - // CodeIgniter 3.0.5 and before |
|
66 | - $contents = str_replace( |
|
67 | - "define('FCPATH', realpath(dirname(__FILE__).'/../..').'/');", |
|
68 | - "define('FCPATH', realpath(dirname(__FILE__).'/../public').'/');", |
|
69 | - $contents |
|
70 | - ); |
|
71 | - if ($app != 'application') { |
|
72 | - $contents = str_replace( |
|
73 | - "\$application_folder = '../../application';", |
|
74 | - "\$application_folder = '../../{$app}';", |
|
75 | - $contents |
|
76 | - ); |
|
77 | - } |
|
78 | - } else { |
|
79 | - throw new Exception('Can\'t find "index.php".'); |
|
80 | - } |
|
81 | - } |
|
44 | + if (! file_exists('index.php')) { |
|
45 | + if (file_exists('public/index.php')) { |
|
46 | + // CodeIgniter 3.0.6 and after |
|
47 | + $contents = str_replace( |
|
48 | + "define('FCPATH', realpath(dirname(__FILE__).'/../..').DIRECTORY_SEPARATOR);", |
|
49 | + "define('FCPATH', realpath(dirname(__FILE__).'/../../public').DIRECTORY_SEPARATOR);", |
|
50 | + $contents |
|
51 | + ); |
|
52 | + // CodeIgniter 3.0.5 and before |
|
53 | + $contents = str_replace( |
|
54 | + "define('FCPATH', realpath(dirname(__FILE__).'/../..').'/');", |
|
55 | + "define('FCPATH', realpath(dirname(__FILE__).'/../../public').'/');", |
|
56 | + $contents |
|
57 | + ); |
|
58 | + } elseif (file_exists($app . '/public/index.php')) { |
|
59 | + // CodeIgniter 3.0.6 and after |
|
60 | + $contents = str_replace( |
|
61 | + "define('FCPATH', realpath(dirname(__FILE__).'/../..').DIRECTORY_SEPARATOR);", |
|
62 | + "define('FCPATH', realpath(dirname(__FILE__).'/../public').DIRECTORY_SEPARATOR);", |
|
63 | + $contents |
|
64 | + ); |
|
65 | + // CodeIgniter 3.0.5 and before |
|
66 | + $contents = str_replace( |
|
67 | + "define('FCPATH', realpath(dirname(__FILE__).'/../..').'/');", |
|
68 | + "define('FCPATH', realpath(dirname(__FILE__).'/../public').'/');", |
|
69 | + $contents |
|
70 | + ); |
|
71 | + if ($app != 'application') { |
|
72 | + $contents = str_replace( |
|
73 | + "\$application_folder = '../../application';", |
|
74 | + "\$application_folder = '../../{$app}';", |
|
75 | + $contents |
|
76 | + ); |
|
77 | + } |
|
78 | + } else { |
|
79 | + throw new Exception('Can\'t find "index.php".'); |
|
80 | + } |
|
81 | + } |
|
82 | 82 | |
83 | - file_put_contents($file, $contents); |
|
84 | - } |
|
83 | + file_put_contents($file, $contents); |
|
84 | + } |
|
85 | 85 | |
86 | - public static function update($app = 'application') |
|
87 | - { |
|
88 | - $target_dir = $app . '/' . static::TEST_FOLDER . '/_ci_phpunit_test'; |
|
89 | - self::recursiveUnlink($target_dir); |
|
90 | - self::recursiveCopy( |
|
91 | - dirname(__FILE__) . '/application/tests/_ci_phpunit_test', |
|
92 | - $target_dir |
|
93 | - ); |
|
94 | - } |
|
86 | + public static function update($app = 'application') |
|
87 | + { |
|
88 | + $target_dir = $app . '/' . static::TEST_FOLDER . '/_ci_phpunit_test'; |
|
89 | + self::recursiveUnlink($target_dir); |
|
90 | + self::recursiveCopy( |
|
91 | + dirname(__FILE__) . '/application/tests/_ci_phpunit_test', |
|
92 | + $target_dir |
|
93 | + ); |
|
94 | + } |
|
95 | 95 | |
96 | - /** |
|
97 | - * Recursive Copy |
|
98 | - * |
|
99 | - * @param string $src |
|
100 | - * @param string $dst |
|
101 | - */ |
|
102 | - private static function recursiveCopy($src, $dst) |
|
103 | - { |
|
104 | - @mkdir($dst, 0755); |
|
96 | + /** |
|
97 | + * Recursive Copy |
|
98 | + * |
|
99 | + * @param string $src |
|
100 | + * @param string $dst |
|
101 | + */ |
|
102 | + private static function recursiveCopy($src, $dst) |
|
103 | + { |
|
104 | + @mkdir($dst, 0755); |
|
105 | 105 | |
106 | - $iterator = new \RecursiveIteratorIterator( |
|
107 | - new \RecursiveDirectoryIterator($src, \RecursiveDirectoryIterator::SKIP_DOTS), |
|
108 | - \RecursiveIteratorIterator::SELF_FIRST |
|
109 | - ); |
|
106 | + $iterator = new \RecursiveIteratorIterator( |
|
107 | + new \RecursiveDirectoryIterator($src, \RecursiveDirectoryIterator::SKIP_DOTS), |
|
108 | + \RecursiveIteratorIterator::SELF_FIRST |
|
109 | + ); |
|
110 | 110 | |
111 | - foreach ($iterator as $file) { |
|
112 | - if ($file->isDir()) { |
|
113 | - @mkdir($dst . '/' . $iterator->getSubPathName()); |
|
114 | - } else { |
|
115 | - $success = copy($file, $dst . '/' . $iterator->getSubPathName()); |
|
116 | - if ($success) { |
|
117 | - echo 'copied: ' . $dst . '/' . $iterator->getSubPathName() . PHP_EOL; |
|
118 | - } |
|
119 | - } |
|
120 | - } |
|
121 | - } |
|
111 | + foreach ($iterator as $file) { |
|
112 | + if ($file->isDir()) { |
|
113 | + @mkdir($dst . '/' . $iterator->getSubPathName()); |
|
114 | + } else { |
|
115 | + $success = copy($file, $dst . '/' . $iterator->getSubPathName()); |
|
116 | + if ($success) { |
|
117 | + echo 'copied: ' . $dst . '/' . $iterator->getSubPathName() . PHP_EOL; |
|
118 | + } |
|
119 | + } |
|
120 | + } |
|
121 | + } |
|
122 | 122 | |
123 | - /** |
|
124 | - * Recursive Unlink |
|
125 | - * |
|
126 | - * @param string $dir |
|
127 | - */ |
|
128 | - private static function recursiveUnlink($dir) |
|
129 | - { |
|
130 | - $iterator = new \RecursiveIteratorIterator( |
|
131 | - new \RecursiveDirectoryIterator($dir, \RecursiveDirectoryIterator::SKIP_DOTS), |
|
132 | - \RecursiveIteratorIterator::CHILD_FIRST |
|
133 | - ); |
|
123 | + /** |
|
124 | + * Recursive Unlink |
|
125 | + * |
|
126 | + * @param string $dir |
|
127 | + */ |
|
128 | + private static function recursiveUnlink($dir) |
|
129 | + { |
|
130 | + $iterator = new \RecursiveIteratorIterator( |
|
131 | + new \RecursiveDirectoryIterator($dir, \RecursiveDirectoryIterator::SKIP_DOTS), |
|
132 | + \RecursiveIteratorIterator::CHILD_FIRST |
|
133 | + ); |
|
134 | 134 | |
135 | - foreach ($iterator as $file) { |
|
136 | - if ($file->isDir()) { |
|
137 | - rmdir($file); |
|
138 | - } else { |
|
139 | - unlink($file); |
|
140 | - } |
|
141 | - } |
|
135 | + foreach ($iterator as $file) { |
|
136 | + if ($file->isDir()) { |
|
137 | + rmdir($file); |
|
138 | + } else { |
|
139 | + unlink($file); |
|
140 | + } |
|
141 | + } |
|
142 | 142 | |
143 | - rmdir($dir); |
|
144 | - } |
|
143 | + rmdir($dir); |
|
144 | + } |
|
145 | 145 | } |
@@ -13,7 +13,6 @@ |
||
13 | 13 | use PhpParser\Node; |
14 | 14 | use PhpParser\Node\Stmt\ClassMethod; |
15 | 15 | use PhpParser\NodeVisitorAbstract; |
16 | - |
|
17 | 16 | use Kenjis\MonkeyPatch\Patcher\MethodPatcher; |
18 | 17 | |
19 | 18 | class NodeVisitor extends NodeVisitorAbstract |
@@ -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,26 +47,26 @@ 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 | 62 | $replacement = new FullyQualified(array()); |
63 | 63 | $replacement->set( |
64 | - '\__ConstProxy__::get(\'' . (string) $node->name . '\')' |
|
64 | + '\__ConstProxy__::get(\''.(string) $node->name.'\')' |
|
65 | 65 | ); |
66 | 66 | |
67 | 67 | $pos = $node->getAttribute('startTokenPos'); |
68 | 68 | ConstantPatcher::$replacement[$pos] = |
69 | - '\__ConstProxy__::get(\'' . (string) $node->name .'\')'; |
|
69 | + '\__ConstProxy__::get(\''.(string) $node->name.'\')'; |
|
70 | 70 | |
71 | 71 | $node->name = $replacement; |
72 | 72 | } |