@@ -59,7 +59,7 @@ |
||
59 | 59 | { |
60 | 60 | $this->unwrap(); |
61 | 61 | |
62 | - MonkeyPatchManager::log('stream_open: ' . $path); |
|
62 | + MonkeyPatchManager::log('stream_open: '.$path); |
|
63 | 63 | |
64 | 64 | $including = (bool) ($options & self::STREAM_OPEN_FOR_INCLUDE); |
65 | 65 | if ($including && $this->shouldPreprocess($path)) { |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | PHPUnit_Framework_TestCase::assertEquals( |
55 | 55 | $expected_times, |
56 | 56 | $actual_times, |
57 | - $class_method . '() expected to be not invoked, but invoked ' . $actual_times . ' times.' |
|
57 | + $class_method.'() expected to be not invoked, but invoked '.$actual_times.' times.' |
|
58 | 58 | ); |
59 | 59 | } |
60 | 60 | elseif ($expected_times === '+') |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | PHPUnit_Framework_TestCase::assertGreaterThanOrEqual( |
63 | 63 | 1, |
64 | 64 | $actual_times, |
65 | - $class_method . '() expected to be invoked at least one time, but invoked ' . $actual_times . ' times.' |
|
65 | + $class_method.'() expected to be invoked at least one time, but invoked '.$actual_times.' times.' |
|
66 | 66 | ); |
67 | 67 | } |
68 | 68 | else |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | PHPUnit_Framework_TestCase::assertEquals( |
71 | 71 | $expected_times, |
72 | 72 | $actual_times, |
73 | - $class_method . '() expected to be invoked ' . $expected_times . ' times, but invoked ' . $actual_times . ' times.' |
|
73 | + $class_method.'() expected to be invoked '.$expected_times.' times, but invoked '.$actual_times.' times.' |
|
74 | 74 | ); |
75 | 75 | } |
76 | 76 | } |
@@ -31,12 +31,10 @@ discard block |
||
31 | 31 | if ($invoked === false) |
32 | 32 | { |
33 | 33 | $actual_times = 0; |
34 | - } |
|
35 | - elseif ($expected_params === null) |
|
34 | + } elseif ($expected_params === null) |
|
36 | 35 | { |
37 | 36 | $actual_times = count($invocations[$class_method]); |
38 | - } |
|
39 | - else |
|
37 | + } else |
|
40 | 38 | { |
41 | 39 | $count = 0; |
42 | 40 | foreach ($invocations[$class_method] as $actual_params) |
@@ -56,16 +54,14 @@ discard block |
||
56 | 54 | $actual_times, |
57 | 55 | $class_method . '() expected to be not invoked, but invoked ' . $actual_times . ' times.' |
58 | 56 | ); |
59 | - } |
|
60 | - elseif ($expected_times === '+') |
|
57 | + } elseif ($expected_times === '+') |
|
61 | 58 | { |
62 | 59 | PHPUnit_Framework_TestCase::assertGreaterThanOrEqual( |
63 | 60 | 1, |
64 | 61 | $actual_times, |
65 | 62 | $class_method . '() expected to be invoked at least one time, but invoked ' . $actual_times . ' times.' |
66 | 63 | ); |
67 | - } |
|
68 | - else |
|
64 | + } else |
|
69 | 65 | { |
70 | 66 | PHPUnit_Framework_TestCase::assertEquals( |
71 | 67 | $expected_times, |
@@ -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(); |
@@ -19,8 +19,7 @@ |
||
19 | 19 | if ($class === null) |
20 | 20 | { |
21 | 21 | $message = 'exit() called in ' . $method . '() function'; |
22 | - } |
|
23 | - else |
|
22 | + } else |
|
24 | 23 | { |
25 | 24 | $message = 'exit() called in ' . $class . '::' . $method . '()'; |
26 | 25 | } |
@@ -105,7 +105,7 @@ |
||
105 | 105 | ob_end_clean(); |
106 | 106 | } |
107 | 107 | |
108 | - throw new CIPHPUnitTestRedirectException('Redirect to ' . $uri, $code); |
|
108 | + throw new CIPHPUnitTestRedirectException('Redirect to '.$uri, $code); |
|
109 | 109 | } |
110 | 110 | } |
111 | 111 | } |
@@ -63,16 +63,14 @@ discard block |
||
63 | 63 | if ($method === 'auto' && isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== FALSE) |
64 | 64 | { |
65 | 65 | $method = 'refresh'; |
66 | - } |
|
67 | - elseif ($method !== 'refresh' && (empty($code) OR ! is_numeric($code))) |
|
66 | + } elseif ($method !== 'refresh' && (empty($code) OR ! is_numeric($code))) |
|
68 | 67 | { |
69 | 68 | if (isset($_SERVER['SERVER_PROTOCOL'], $_SERVER['REQUEST_METHOD']) && $_SERVER['SERVER_PROTOCOL'] === 'HTTP/1.1') |
70 | 69 | { |
71 | 70 | $code = ($_SERVER['REQUEST_METHOD'] !== 'GET') |
72 | 71 | ? 303 // reference: http://en.wikipedia.org/wiki/Post/Redirect/Get |
73 | 72 | : 307; |
74 | - } |
|
75 | - else |
|
73 | + } else |
|
76 | 74 | { |
77 | 75 | $code = 302; |
78 | 76 | } |
@@ -97,8 +95,7 @@ discard block |
||
97 | 95 | if (ENVIRONMENT !== 'testing') |
98 | 96 | { |
99 | 97 | exit; |
100 | - } |
|
101 | - else |
|
98 | + } else |
|
102 | 99 | { |
103 | 100 | while (ob_get_level() > 1) |
104 | 101 | { |
@@ -25,7 +25,7 @@ |
||
25 | 25 | public function test_APPPATH() |
26 | 26 | { |
27 | 27 | $actual = realpath(APPPATH); |
28 | - $expected = realpath(__DIR__ . '/../..'); |
|
28 | + $expected = realpath(__DIR__.'/../..'); |
|
29 | 29 | $this->assertEquals( |
30 | 30 | $expected, |
31 | 31 | $actual, |
@@ -102,7 +102,7 @@ |
||
102 | 102 | elseif (strpos($class, 'CI_DB') === 0) |
103 | 103 | { |
104 | 104 | $dir = SYSTEM_PATH.'database'.DIRECTORY_SEPARATOR; |
105 | - $file = $dir.str_replace(array('CI_DB','active_record'), array('DB', 'active_rec'), $subclass).'.php'; |
|
105 | + $file = $dir.str_replace(array('CI_DB', 'active_record'), array('DB', 'active_rec'), $subclass).'.php'; |
|
106 | 106 | } |
107 | 107 | else |
108 | 108 | { |
@@ -63,8 +63,7 @@ discard block |
||
63 | 63 | if (strpos($class, 'Mock_') === 0) |
64 | 64 | { |
65 | 65 | $class = strtolower(str_replace(array('Mock_', '_'), array('', DIRECTORY_SEPARATOR), $class)); |
66 | - } |
|
67 | - elseif (strpos($class, 'CI_') === 0) |
|
66 | + } elseif (strpos($class, 'CI_') === 0) |
|
68 | 67 | { |
69 | 68 | $subclass = substr($class, 3); |
70 | 69 | |
@@ -72,39 +71,32 @@ discard block |
||
72 | 71 | { |
73 | 72 | $dir = SYSTEM_PATH.'core'.DIRECTORY_SEPARATOR; |
74 | 73 | $class = $subclass; |
75 | - } |
|
76 | - elseif (in_array($subclass, $ci_libraries)) |
|
74 | + } elseif (in_array($subclass, $ci_libraries)) |
|
77 | 75 | { |
78 | 76 | $dir = SYSTEM_PATH.'libraries'.DIRECTORY_SEPARATOR; |
79 | 77 | $class = ($subclass === 'Driver_Library') ? 'Driver' : $subclass; |
80 | - } |
|
81 | - elseif (in_array($subclass, $ci_drivers)) |
|
78 | + } elseif (in_array($subclass, $ci_drivers)) |
|
82 | 79 | { |
83 | 80 | $dir = SYSTEM_PATH.'libraries'.DIRECTORY_SEPARATOR.$subclass.DIRECTORY_SEPARATOR; |
84 | 81 | $class = $subclass; |
85 | - } |
|
86 | - elseif (in_array(($parent = strtok($subclass, '_')), $ci_drivers)) { |
|
82 | + } elseif (in_array(($parent = strtok($subclass, '_')), $ci_drivers)) { |
|
87 | 83 | $dir = SYSTEM_PATH.'libraries'.DIRECTORY_SEPARATOR.$parent.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR; |
88 | 84 | $class = $subclass; |
89 | - } |
|
90 | - elseif (preg_match('/^CI_DB_(.+)_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 4) |
|
85 | + } elseif (preg_match('/^CI_DB_(.+)_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 4) |
|
91 | 86 | { |
92 | 87 | $driver_path = SYSTEM_PATH.'database'.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR; |
93 | 88 | $dir = $driver_path.$m[1].DIRECTORY_SEPARATOR.'subdrivers'.DIRECTORY_SEPARATOR; |
94 | 89 | $file = $dir.$m[1].'_'.$m[2].'_'.$m[3].'.php'; |
95 | - } |
|
96 | - elseif (preg_match('/^CI_DB_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 3) |
|
90 | + } elseif (preg_match('/^CI_DB_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 3) |
|
97 | 91 | { |
98 | 92 | $driver_path = SYSTEM_PATH.'database'.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR; |
99 | 93 | $dir = $driver_path.$m[1].DIRECTORY_SEPARATOR; |
100 | 94 | $file = $dir.$m[1].'_'.$m[2].'.php'; |
101 | - } |
|
102 | - elseif (strpos($class, 'CI_DB') === 0) |
|
95 | + } elseif (strpos($class, 'CI_DB') === 0) |
|
103 | 96 | { |
104 | 97 | $dir = SYSTEM_PATH.'database'.DIRECTORY_SEPARATOR; |
105 | 98 | $file = $dir.str_replace(array('CI_DB','active_record'), array('DB', 'active_rec'), $subclass).'.php'; |
106 | - } |
|
107 | - else |
|
99 | + } else |
|
108 | 100 | { |
109 | 101 | $class = strtolower($class); |
110 | 102 | } |
@@ -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 | } |
@@ -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, |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | /** |
238 | 238 | * Fetch an item from the GET array |
239 | 239 | * |
240 | - * @param mixed $index Index for item to be fetched from $_GET |
|
240 | + * @param string $index Index for item to be fetched from $_GET |
|
241 | 241 | * @param bool $xss_clean Whether to apply XSS filtering |
242 | 242 | * @return mixed |
243 | 243 | * |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | /** |
254 | 254 | * Fetch an item from the POST array |
255 | 255 | * |
256 | - * @param mixed $index Index for item to be fetched from $_POST |
|
256 | + * @param string $index Index for item to be fetched from $_POST |
|
257 | 257 | * @param bool $xss_clean Whether to apply XSS filtering |
258 | 258 | * @return mixed |
259 | 259 | * |
@@ -321,9 +321,9 @@ discard block |
||
321 | 321 | /** |
322 | 322 | * Fetch an item from the SERVER array |
323 | 323 | * |
324 | - * @param mixed $index Index for item to be fetched from $_SERVER |
|
324 | + * @param string $index Index for item to be fetched from $_SERVER |
|
325 | 325 | * @param bool $xss_clean Whether to apply XSS filtering |
326 | - * @return mixed |
|
326 | + * @return string |
|
327 | 327 | * |
328 | 328 | * @codeCoverageIgnore |
329 | 329 | */ |
@@ -934,7 +934,7 @@ discard block |
||
934 | 934 | * Allows read access to protected properties |
935 | 935 | * |
936 | 936 | * @param string $name |
937 | - * @return mixed |
|
937 | + * @return string|null |
|
938 | 938 | * |
939 | 939 | * @codeCoverageIgnore |
940 | 940 | */ |
@@ -200,29 +200,30 @@ discard block |
||
200 | 200 | if (isset($array[$index])) |
201 | 201 | { |
202 | 202 | $value = $array[$index]; |
203 | - } |
|
204 | - elseif (($count = preg_match_all('/(?:^[^\[]+)|\[[^]]*\]/', $index, $matches)) > 1) // Does the index contain array notation |
|
203 | + } elseif (($count = preg_match_all('/(?:^[^\[]+)|\[[^]]*\]/', $index, $matches)) > 1) { |
|
204 | + // Does the index contain array notation |
|
205 | 205 | { |
206 | 206 | $value = $array; |
207 | + } |
|
207 | 208 | for ($i = 0; $i < $count; $i++) |
208 | 209 | { |
209 | 210 | $key = trim($matches[0][$i], '[]'); |
210 | - if ($key === '') // Empty notation will return the value as array |
|
211 | + if ($key === '') { |
|
212 | + // Empty notation will return the value as array |
|
211 | 213 | { |
212 | 214 | break; |
213 | 215 | } |
216 | + } |
|
214 | 217 | |
215 | 218 | if (isset($value[$key])) |
216 | 219 | { |
217 | 220 | $value = $value[$key]; |
218 | - } |
|
219 | - else |
|
221 | + } else |
|
220 | 222 | { |
221 | 223 | return NULL; |
222 | 224 | } |
223 | 225 | } |
224 | - } |
|
225 | - else |
|
226 | + } else |
|
226 | 227 | { |
227 | 228 | return NULL; |
228 | 229 | } |
@@ -421,8 +422,7 @@ discard block |
||
421 | 422 | if ( ! is_numeric($expire)) |
422 | 423 | { |
423 | 424 | $expire = time() - 86500; |
424 | - } |
|
425 | - else |
|
425 | + } else |
|
426 | 426 | { |
427 | 427 | $expire = ($expire > 0) ? time() + $expire : 0; |
428 | 428 | } |
@@ -483,8 +483,7 @@ discard block |
||
483 | 483 | if ( ! $this->valid_ip($spoof)) |
484 | 484 | { |
485 | 485 | $spoof = NULL; |
486 | - } |
|
487 | - else |
|
486 | + } else |
|
488 | 487 | { |
489 | 488 | break; |
490 | 489 | } |
@@ -537,8 +536,7 @@ discard block |
||
537 | 536 | } |
538 | 537 | |
539 | 538 | $sprintf = '%016b%016b%016b%016b%016b%016b%016b%016b'; |
540 | - } |
|
541 | - else |
|
539 | + } else |
|
542 | 540 | { |
543 | 541 | $ip = explode('.', $this->ip_address); |
544 | 542 | $sprintf = '%08b%08b%08b%08b'; |
@@ -558,8 +556,7 @@ discard block |
||
558 | 556 | { |
559 | 557 | $netaddr[$j] = intval($netaddr[$j], 16); |
560 | 558 | } |
561 | - } |
|
562 | - else |
|
559 | + } else |
|
563 | 560 | { |
564 | 561 | $netaddr = explode('.', $netaddr); |
565 | 562 | } |
@@ -646,8 +643,7 @@ discard block |
||
646 | 643 | if ($this->_allow_get_array === FALSE) |
647 | 644 | { |
648 | 645 | $_GET = array(); |
649 | - } |
|
650 | - elseif (is_array($_GET)) |
|
646 | + } elseif (is_array($_GET)) |
|
651 | 647 | { |
652 | 648 | foreach ($_GET as $key => $val) |
653 | 649 | { |
@@ -683,8 +679,7 @@ discard block |
||
683 | 679 | if (($cookie_key = $this->_clean_input_keys($key)) !== FALSE) |
684 | 680 | { |
685 | 681 | $_COOKIE[$cookie_key] = $this->_clean_input_data($val); |
686 | - } |
|
687 | - else |
|
682 | + } else |
|
688 | 683 | { |
689 | 684 | unset($_COOKIE[$key]); |
690 | 685 | } |
@@ -774,8 +769,7 @@ discard block |
||
774 | 769 | if ($fatal === TRUE) |
775 | 770 | { |
776 | 771 | return FALSE; |
777 | - } |
|
778 | - else |
|
772 | + } else |
|
779 | 773 | { |
780 | 774 | set_status_header(503); |
781 | 775 | echo 'Disallowed Key Characters.'; |
@@ -814,8 +808,7 @@ discard block |
||
814 | 808 | if (function_exists('apache_request_headers')) |
815 | 809 | { |
816 | 810 | $this->headers = apache_request_headers(); |
817 | - } |
|
818 | - else |
|
811 | + } else |
|
819 | 812 | { |
820 | 813 | isset($_SERVER['CONTENT_TYPE']) && $this->headers['Content-Type'] = $_SERVER['CONTENT_TYPE']; |
821 | 814 | |
@@ -944,8 +937,7 @@ discard block |
||
944 | 937 | { |
945 | 938 | isset($this->_raw_input_stream) OR $this->_raw_input_stream = file_get_contents('php://input'); |
946 | 939 | return $this->_raw_input_stream; |
947 | - } |
|
948 | - elseif ($name === 'ip_address') |
|
940 | + } elseif ($name === 'ip_address') |
|
949 | 941 | { |
950 | 942 | return $this->ip_address; |
951 | 943 | } |
@@ -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,21 +419,18 @@ 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'; |
440 | - } |
|
441 | - elseif ( ! method_exists($class, $method)) |
|
433 | + } elseif ( ! method_exists($class, $method)) |
|
442 | 434 | { |
443 | 435 | $e404 = TRUE; |
444 | 436 | } |
@@ -490,8 +482,7 @@ discard block |
||
490 | 482 | $RTR->directory = ''; |
491 | 483 | } |
492 | 484 | } |
493 | - } |
|
494 | - else |
|
485 | + } else |
|
495 | 486 | { |
496 | 487 | $e404 = FALSE; |
497 | 488 | } |
@@ -507,8 +498,7 @@ discard block |
||
507 | 498 | 1 => $class, |
508 | 499 | 2 => $method |
509 | 500 | ); |
510 | - } |
|
511 | - else |
|
501 | + } else |
|
512 | 502 | { |
513 | 503 | show_404($RTR->directory.$class.'/'.$method); |
514 | 504 | } |