@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * |
77 | 77 | * @var array |
78 | 78 | */ |
79 | - public $mimes = array(); |
|
79 | + public $mimes = array(); |
|
80 | 80 | |
81 | 81 | /** |
82 | 82 | * Mime-type for the current page |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * |
112 | 112 | * @var array |
113 | 113 | */ |
114 | - protected $_profiler_sections = array(); |
|
114 | + protected $_profiler_sections = array(); |
|
115 | 115 | |
116 | 116 | /** |
117 | 117 | * Parse markers flag |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | isset(self::$func_overload) OR self::$func_overload = (extension_loaded('mbstring') && ini_get('mbstring.func_overload')); |
167 | 167 | |
168 | 168 | // Get mime types for later |
169 | - $this->mimes =& get_mimes(); |
|
169 | + $this->mimes = & get_mimes(); |
|
170 | 170 | |
171 | 171 | log_message('info', 'Output Class Initialized'); |
172 | 172 | } |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | // Is this extension supported? |
265 | 265 | if (isset($this->mimes[$extension])) |
266 | 266 | { |
267 | - $mime_type =& $this->mimes[$extension]; |
|
267 | + $mime_type = & $this->mimes[$extension]; |
|
268 | 268 | |
269 | 269 | if (is_array($mime_type)) |
270 | 270 | { |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | { |
335 | 335 | if (strncasecmp($header, $headers[$c], $l = self::strlen($header)) === 0) |
336 | 336 | { |
337 | - return trim(self::substr($headers[$c], $l+1)); |
|
337 | + return trim(self::substr($headers[$c], $l + 1)); |
|
338 | 338 | } |
339 | 339 | } |
340 | 340 | |
@@ -437,13 +437,13 @@ discard block |
||
437 | 437 | // Note: We use load_class() because we can't use $CI =& get_instance() |
438 | 438 | // since this function is sometimes called by the caching mechanism, |
439 | 439 | // which happens before the CI super object is available. |
440 | - $BM =& load_class('Benchmark', 'core'); |
|
441 | - $CFG =& load_class('Config', 'core'); |
|
440 | + $BM = & load_class('Benchmark', 'core'); |
|
441 | + $CFG = & load_class('Config', 'core'); |
|
442 | 442 | |
443 | 443 | // Grab the super object if we can. |
444 | 444 | if (class_exists('CI_Controller', FALSE)) |
445 | 445 | { |
446 | - $CI =& get_instance(); |
|
446 | + $CI = & get_instance(); |
|
447 | 447 | } |
448 | 448 | |
449 | 449 | // -------------------------------------------------------------------- |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | // Set the output data |
452 | 452 | if ($output === '') |
453 | 453 | { |
454 | - $output =& $this->final_output; |
|
454 | + $output = & $this->final_output; |
|
455 | 455 | } |
456 | 456 | |
457 | 457 | // -------------------------------------------------------------------- |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | */ |
573 | 573 | public function _write_cache($output) |
574 | 574 | { |
575 | - $CI =& get_instance(); |
|
575 | + $CI = & get_instance(); |
|
576 | 576 | $path = $CI->config->item('cache_path'); |
577 | 577 | $cache_path = ($path === '') ? APPPATH.'cache/' : $path; |
578 | 578 | |
@@ -751,7 +751,7 @@ discard block |
||
751 | 751 | */ |
752 | 752 | public function delete_cache($uri = '') |
753 | 753 | { |
754 | - $CI =& get_instance(); |
|
754 | + $CI = & get_instance(); |
|
755 | 755 | $cache_path = $CI->config->item('cache_path'); |
756 | 756 | if ($cache_path === '') |
757 | 757 | { |
@@ -511,8 +511,7 @@ discard block |
||
511 | 511 | { |
512 | 512 | // header('Content-Encoding: gzip'); |
513 | 513 | // header('Content-Length: '.self::strlen($output)); |
514 | - } |
|
515 | - else |
|
514 | + } else |
|
516 | 515 | { |
517 | 516 | // User agent doesn't support gzip compression, |
518 | 517 | // so we'll have to decompress our cache |
@@ -552,8 +551,7 @@ discard block |
||
552 | 551 | if (method_exists($CI, '_output')) |
553 | 552 | { |
554 | 553 | $CI->_output($output); |
555 | - } |
|
556 | - else |
|
554 | + } else |
|
557 | 555 | { |
558 | 556 | echo $output; // Send it to the browser! |
559 | 557 | } |
@@ -591,8 +589,7 @@ discard block |
||
591 | 589 | if (is_array($cache_query_string)) |
592 | 590 | { |
593 | 591 | $uri .= '?'.http_build_query(array_intersect_key($_GET, array_flip($cache_query_string))); |
594 | - } |
|
595 | - else |
|
592 | + } else |
|
596 | 593 | { |
597 | 594 | $uri .= '?'.$_SERVER['QUERY_STRING']; |
598 | 595 | } |
@@ -685,8 +682,7 @@ discard block |
||
685 | 682 | if (is_array($cache_query_string)) |
686 | 683 | { |
687 | 684 | $uri .= '?'.http_build_query(array_intersect_key($_GET, array_flip($cache_query_string))); |
688 | - } |
|
689 | - else |
|
685 | + } else |
|
690 | 686 | { |
691 | 687 | $uri .= '?'.$_SERVER['QUERY_STRING']; |
692 | 688 | } |
@@ -773,8 +769,7 @@ discard block |
||
773 | 769 | if (is_array($cache_query_string)) |
774 | 770 | { |
775 | 771 | $uri .= '?'.http_build_query(array_intersect_key($_GET, array_flip($cache_query_string))); |
776 | - } |
|
777 | - else |
|
772 | + } else |
|
778 | 773 | { |
779 | 774 | $uri .= '?'.$_SERVER['QUERY_STRING']; |
780 | 775 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | public static function init(array $autoload_dirs = null) |
22 | 22 | { |
23 | - if (! defined('TESTPATH')) { |
|
23 | + if ( ! defined('TESTPATH')) { |
|
24 | 24 | define('TESTPATH', APPPATH.'tests'.DIRECTORY_SEPARATOR); |
25 | 25 | } |
26 | 26 | |
@@ -37,38 +37,38 @@ discard block |
||
37 | 37 | $cwd_backup = getcwd(); |
38 | 38 | |
39 | 39 | // Load autoloader for ci-phpunit-test |
40 | - require __DIR__ . '/autoloader.php'; |
|
40 | + require __DIR__.'/autoloader.php'; |
|
41 | 41 | |
42 | - require TESTPATH . 'TestCase.php'; |
|
42 | + require TESTPATH.'TestCase.php'; |
|
43 | 43 | |
44 | - $db_test_case_file = TESTPATH . 'DbTestCase.php'; |
|
44 | + $db_test_case_file = TESTPATH.'DbTestCase.php'; |
|
45 | 45 | if (is_readable($db_test_case_file)) |
46 | 46 | { |
47 | 47 | require $db_test_case_file; |
48 | 48 | } |
49 | 49 | |
50 | - $unit_test_case_file = TESTPATH . 'UnitTestCase.php'; |
|
50 | + $unit_test_case_file = TESTPATH.'UnitTestCase.php'; |
|
51 | 51 | if (is_readable($unit_test_case_file)) |
52 | 52 | { |
53 | 53 | require $unit_test_case_file; |
54 | 54 | } |
55 | 55 | |
56 | 56 | // Replace a few Common functions |
57 | - require __DIR__ . '/replacing/core/Common.php'; |
|
58 | - require BASEPATH . 'core/Common.php'; |
|
57 | + require __DIR__.'/replacing/core/Common.php'; |
|
58 | + require BASEPATH.'core/Common.php'; |
|
59 | 59 | |
60 | 60 | // Workaround for missing CodeIgniter's error handler |
61 | 61 | // See https://github.com/kenjis/ci-phpunit-test/issues/37 |
62 | 62 | set_error_handler('_error_handler'); |
63 | 63 | |
64 | 64 | // Load new functions of CIPHPUnitTest |
65 | - require __DIR__ . '/functions.php'; |
|
65 | + require __DIR__.'/functions.php'; |
|
66 | 66 | // Load ci-phpunit-test CI_Loader |
67 | - require __DIR__ . '/replacing/core/Loader.php'; |
|
67 | + require __DIR__.'/replacing/core/Loader.php'; |
|
68 | 68 | // Load ci-phpunit-test CI_Input |
69 | - require __DIR__ . '/replacing/core/Input.php'; |
|
69 | + require __DIR__.'/replacing/core/Input.php'; |
|
70 | 70 | // Load ci-phpunit-test CI_Output |
71 | - require __DIR__ . '/replacing/core/Output.php'; |
|
71 | + require __DIR__.'/replacing/core/Output.php'; |
|
72 | 72 | |
73 | 73 | // Change current directory |
74 | 74 | chdir(FCPATH); |
@@ -80,12 +80,12 @@ discard block |
||
80 | 80 | * |
81 | 81 | * And away we go... |
82 | 82 | */ |
83 | - require __DIR__ . '/replacing/core/CodeIgniter.php'; |
|
83 | + require __DIR__.'/replacing/core/CodeIgniter.php'; |
|
84 | 84 | |
85 | 85 | self::replaceHelpers(); |
86 | 86 | |
87 | 87 | // Create CodeIgniter instance |
88 | - if (! self::wiredesignzHmvcInstalled()) |
|
88 | + if ( ! self::wiredesignzHmvcInstalled()) |
|
89 | 89 | { |
90 | 90 | new CI_Controller(); |
91 | 91 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | public static function createCodeIgniterInstance() |
108 | 108 | { |
109 | - if (! self::wiredesignzHmvcInstalled()) |
|
109 | + if ( ! self::wiredesignzHmvcInstalled()) |
|
110 | 110 | { |
111 | 111 | new CI_Controller(); |
112 | 112 | } |
@@ -135,11 +135,11 @@ discard block |
||
135 | 135 | protected static function replaceLoader() |
136 | 136 | { |
137 | 137 | $my_loader_file = |
138 | - APPPATH . 'core/' . config_item('subclass_prefix') . 'Loader.php'; |
|
138 | + APPPATH.'core/'.config_item('subclass_prefix').'Loader.php'; |
|
139 | 139 | |
140 | 140 | if (file_exists($my_loader_file)) |
141 | 141 | { |
142 | - self::$loader_class = config_item('subclass_prefix') . 'Loader'; |
|
142 | + self::$loader_class = config_item('subclass_prefix').'Loader'; |
|
143 | 143 | if ( ! class_exists(self::$loader_class)) |
144 | 144 | { |
145 | 145 | require $my_loader_file; |
@@ -158,19 +158,19 @@ discard block |
||
158 | 158 | |
159 | 159 | protected static function loadHelper($helper) |
160 | 160 | { |
161 | - $my_helper_file = APPPATH . 'helpers/' . config_item('subclass_prefix') . $helper . '.php'; |
|
161 | + $my_helper_file = APPPATH.'helpers/'.config_item('subclass_prefix').$helper.'.php'; |
|
162 | 162 | if (file_exists($my_helper_file)) |
163 | 163 | { |
164 | 164 | require $my_helper_file; |
165 | 165 | } |
166 | - require __DIR__ . '/replacing/helpers/' . $helper . '.php'; |
|
166 | + require __DIR__.'/replacing/helpers/'.$helper.'.php'; |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | public static function setPatcherCacheDir($dir = null) |
170 | 170 | { |
171 | 171 | if ($dir === null) |
172 | 172 | { |
173 | - $dir = TESTPATH . '_ci_phpunit_test/tmp/cache'; |
|
173 | + $dir = TESTPATH.'_ci_phpunit_test/tmp/cache'; |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | MonkeyPatchManager::setCacheDir( |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | */ |
10 | 10 | |
11 | 11 | // Support PHPUnit 6.0 |
12 | -if (! class_exists('PHPUnit_Framework_TestCase')) |
|
12 | +if ( ! class_exists('PHPUnit_Framework_TestCase')) |
|
13 | 13 | { |
14 | 14 | class_alias('PHPUnit\Framework\TestCase', 'PHPUnit_Framework_TestCase'); |
15 | 15 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | return $this->$name; |
65 | 65 | } |
66 | 66 | |
67 | - throw new LogicException('No such property: ' . $name); |
|
67 | + throw new LogicException('No such property: '.$name); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | public static function setUpBeforeClass() |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | { |
88 | 88 | reset_instance(); |
89 | 89 | CIPHPUnitTest::createCodeIgniterInstance(); |
90 | - $this->CI =& get_instance(); |
|
90 | + $this->CI = & get_instance(); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | protected function tearDown() |
@@ -164,8 +164,8 @@ discard block |
||
164 | 164 | } |
165 | 165 | |
166 | 166 | set_error_handler( |
167 | - function ($errno, $errstr, $errfile, $errline) { |
|
168 | - throw new RuntimeException($errstr . ' on line ' . $errline . ' in file ' . $errfile); |
|
167 | + function($errno, $errstr, $errfile, $errline) { |
|
168 | + throw new RuntimeException($errstr.' on line '.$errline.' in file '.$errfile); |
|
169 | 169 | } |
170 | 170 | ); |
171 | 171 | |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | $this->assertSame( |
303 | 303 | $code, |
304 | 304 | $actual, |
305 | - 'Status code is not ' . $code . ' but ' . $actual . '.' |
|
305 | + 'Status code is not '.$code.' but '.$actual.'.' |
|
306 | 306 | ); |
307 | 307 | } |
308 | 308 | |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | */ |
315 | 315 | public function assertResponseHeader($name, $value) |
316 | 316 | { |
317 | - $CI =& get_instance(); |
|
317 | + $CI = & get_instance(); |
|
318 | 318 | $actual = $CI->output->get_header($name); |
319 | 319 | |
320 | 320 | if ($actual === null) |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | */ |
339 | 339 | public function assertResponseCookie($name, $value, $allow_duplicate = false) |
340 | 340 | { |
341 | - $CI =& get_instance(); |
|
341 | + $CI = & get_instance(); |
|
342 | 342 | $cookies = isset($CI->output->_cookies[$name]) |
343 | 343 | ? $CI->output->_cookies[$name] : null; |
344 | 344 | |
@@ -406,23 +406,23 @@ discard block |
||
406 | 406 | $this->fail('redirect() is not called.'); |
407 | 407 | } |
408 | 408 | |
409 | - if (! function_exists('site_url')) |
|
409 | + if ( ! function_exists('site_url')) |
|
410 | 410 | { |
411 | - $CI =& get_instance(); |
|
411 | + $CI = & get_instance(); |
|
412 | 412 | $CI->load->helper('url'); |
413 | 413 | } |
414 | 414 | |
415 | - if (! preg_match('#^(\w+:)?//#i', $uri)) |
|
415 | + if ( ! preg_match('#^(\w+:)?//#i', $uri)) |
|
416 | 416 | { |
417 | 417 | $uri = site_url($uri); |
418 | 418 | } |
419 | 419 | $absolute_url = $uri; |
420 | - $expected = 'Redirect to ' . $absolute_url; |
|
420 | + $expected = 'Redirect to '.$absolute_url; |
|
421 | 421 | |
422 | 422 | $this->assertSame( |
423 | 423 | $expected, |
424 | 424 | $status['redirect'], |
425 | - 'URL to redirect is not ' . $expected . ' but ' . $status['redirect'] . '.' |
|
425 | + 'URL to redirect is not '.$expected.' but '.$status['redirect'].'.' |
|
426 | 426 | ); |
427 | 427 | |
428 | 428 | if ($code !== null) |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | $this->assertSame( |
431 | 431 | $code, |
432 | 432 | $status['code'], |
433 | - 'Status code is not ' . $code . ' but ' . $status['code'] . '.' |
|
433 | + 'Status code is not '.$code.' but '.$status['code'].'.' |
|
434 | 434 | ); |
435 | 435 | } |
436 | 436 | } |