@@ -10,8 +10,8 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | namespace Kenjis\MonkeyPatch\Patcher; |
| 12 | 12 | |
| 13 | -require __DIR__ . '/MethodPatcher/NodeVisitor.php'; |
|
| 14 | -require __DIR__ . '/MethodPatcher/PatchManager.php'; |
|
| 13 | +require __DIR__.'/MethodPatcher/NodeVisitor.php'; |
|
| 14 | +require __DIR__.'/MethodPatcher/PatchManager.php'; |
|
| 15 | 15 | |
| 16 | 16 | use LogicException; |
| 17 | 17 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | { |
| 62 | 62 | if ($start_method && $token === '{') |
| 63 | 63 | { |
| 64 | - $new_source .= '{ ' . self::CODE; |
|
| 64 | + $new_source .= '{ '.self::CODE; |
|
| 65 | 65 | $start_method = false; |
| 66 | 66 | $replacement['key'] = key(self::$replacement); |
| 67 | 67 | $replacement['value'] = current(self::$replacement); |
@@ -10,8 +10,8 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | namespace Kenjis\MonkeyPatch\Patcher; |
| 12 | 12 | |
| 13 | -require __DIR__ . '/MethodPatcher/NodeVisitor.php'; |
|
| 14 | -require __DIR__ . '/MethodPatcher/PatchManager.php'; |
|
| 13 | +require __DIR__.'/MethodPatcher/NodeVisitor.php'; |
|
| 14 | +require __DIR__.'/MethodPatcher/PatchManager.php'; |
|
| 15 | 15 | |
| 16 | 16 | use LogicException; |
| 17 | 17 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | { |
| 62 | 62 | if ($start_method && $token === '{') |
| 63 | 63 | { |
| 64 | - $new_source .= '{ ' . self::CODE; |
|
| 64 | + $new_source .= '{ '.self::CODE; |
|
| 65 | 65 | $start_method = false; |
| 66 | 66 | $replacement['key'] = key(self::$replacement); |
| 67 | 67 | $replacement['value'] = current(self::$replacement); |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | { |
| 21 | 21 | reset_instance(); |
| 22 | 22 | $controller = new $classname; |
| 23 | - $this->CI =& get_instance(); |
|
| 23 | + $this->CI = & get_instance(); |
|
| 24 | 24 | return $controller; |
| 25 | 25 | } |
| 26 | 26 | |
@@ -293,8 +293,8 @@ discard block |
||
| 293 | 293 | { |
| 294 | 294 | empty($config) OR $this->initialize($config, FALSE); |
| 295 | 295 | |
| 296 | - $this->_mimes =& get_mimes(); |
|
| 297 | - $this->_CI =& get_instance(); |
|
| 296 | + $this->_mimes = & get_mimes(); |
|
| 297 | + $this->_CI = & get_instance(); |
|
| 298 | 298 | |
| 299 | 299 | log_message('info', 'Upload Class Initialized'); |
| 300 | 300 | } |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | else |
| 481 | 481 | { |
| 482 | 482 | // An extension was provided, let's have it! |
| 483 | - $this->file_ext = $this->get_extension($this->_file_name_override); |
|
| 483 | + $this->file_ext = $this->get_extension($this->_file_name_override); |
|
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | if ( ! $this->is_allowed_filetype(TRUE)) |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | // Convert the file size to kilobytes |
| 494 | 494 | if ($this->file_size > 0) |
| 495 | 495 | { |
| 496 | - $this->file_size = round($this->file_size/1024, 2); |
|
| 496 | + $this->file_size = round($this->file_size / 1024, 2); |
|
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 | // Is the file size within the allowed maximum? |
@@ -818,10 +818,10 @@ discard block |
||
| 818 | 818 | { |
| 819 | 819 | $types = array(1 => 'gif', 2 => 'jpeg', 3 => 'png'); |
| 820 | 820 | |
| 821 | - $this->image_width = $D[0]; |
|
| 822 | - $this->image_height = $D[1]; |
|
| 823 | - $this->image_type = isset($types[$D[2]]) ? $types[$D[2]] : 'unknown'; |
|
| 824 | - $this->image_size_str = $D[3]; // string containing height and width |
|
| 821 | + $this->image_width = $D[0]; |
|
| 822 | + $this->image_height = $D[1]; |
|
| 823 | + $this->image_type = isset($types[$D[2]]) ? $types[$D[2]] : 'unknown'; |
|
| 824 | + $this->image_size_str = $D[3]; // string containing height and width |
|
| 825 | 825 | } |
| 826 | 826 | } |
| 827 | 827 | |
@@ -869,7 +869,7 @@ discard block |
||
| 869 | 869 | $this->file_type = 'image/jpeg'; |
| 870 | 870 | } |
| 871 | 871 | |
| 872 | - $img_mimes = array('image/gif', 'image/jpeg', 'image/png'); |
|
| 872 | + $img_mimes = array('image/gif', 'image/jpeg', 'image/png'); |
|
| 873 | 873 | |
| 874 | 874 | return in_array($this->file_type, $img_mimes, TRUE); |
| 875 | 875 | } |
@@ -1011,7 +1011,7 @@ discard block |
||
| 1011 | 1011 | return FALSE; |
| 1012 | 1012 | } |
| 1013 | 1013 | |
| 1014 | - $this->upload_path = preg_replace('/(.+?)\/*$/', '\\1/', $this->upload_path); |
|
| 1014 | + $this->upload_path = preg_replace('/(.+?)\/*$/', '\\1/', $this->upload_path); |
|
| 1015 | 1015 | return TRUE; |
| 1016 | 1016 | } |
| 1017 | 1017 | |
@@ -1055,9 +1055,9 @@ discard block |
||
| 1055 | 1055 | $ext = ''; |
| 1056 | 1056 | if (strpos($filename, '.') !== FALSE) |
| 1057 | 1057 | { |
| 1058 | - $parts = explode('.', $filename); |
|
| 1059 | - $ext = '.'.array_pop($parts); |
|
| 1060 | - $filename = implode('.', $parts); |
|
| 1058 | + $parts = explode('.', $filename); |
|
| 1059 | + $ext = '.'.array_pop($parts); |
|
| 1060 | + $filename = implode('.', $parts); |
|
| 1061 | 1061 | } |
| 1062 | 1062 | |
| 1063 | 1063 | return substr($filename, 0, ($length - strlen($ext))).$ext; |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | // Load the mime types |
| 104 | - $mimes =& get_mimes(); |
|
| 104 | + $mimes = & get_mimes(); |
|
| 105 | 105 | |
| 106 | 106 | // Only change the default MIME if we can find one |
| 107 | 107 | if (isset($mimes[$extension])) |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | if (ENVIRONMENT === 'testing') |
| 148 | 148 | { |
| 149 | - $CI =& get_instance(); |
|
| 149 | + $CI = & get_instance(); |
|
| 150 | 150 | $CI->output->set_header('Content-Type: '.$mime); |
| 151 | 151 | $CI->output->set_header('Content-Disposition: attachment; filename="'.$filename.'"'); |
| 152 | 152 | $CI->output->set_header('Expires: 0'); |
@@ -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 | } |
@@ -139,17 +139,17 @@ discard block |
||
| 139 | 139 | */ |
| 140 | 140 | public function __construct() |
| 141 | 141 | { |
| 142 | - $this->_allow_get_array = (config_item('allow_get_array') !== FALSE); |
|
| 143 | - $this->_enable_xss = (config_item('global_xss_filtering') === TRUE); |
|
| 144 | - $this->_enable_csrf = (config_item('csrf_protection') === TRUE); |
|
| 145 | - $this->_standardize_newlines = (bool) config_item('standardize_newlines'); |
|
| 142 | + $this->_allow_get_array = (config_item('allow_get_array') !== FALSE); |
|
| 143 | + $this->_enable_xss = (config_item('global_xss_filtering') === TRUE); |
|
| 144 | + $this->_enable_csrf = (config_item('csrf_protection') === TRUE); |
|
| 145 | + $this->_standardize_newlines = (bool) config_item('standardize_newlines'); |
|
| 146 | 146 | |
| 147 | - $this->security =& load_class('Security', 'core'); |
|
| 147 | + $this->security = & load_class('Security', 'core'); |
|
| 148 | 148 | |
| 149 | 149 | // Do we need the UTF-8 class? |
| 150 | 150 | if (UTF8_ENABLED === TRUE) |
| 151 | 151 | { |
| 152 | - $this->uni =& load_class('Utf8', 'core'); |
|
| 152 | + $this->uni = & load_class('Utf8', 'core'); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | // Sanitize global arrays |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | |
| 430 | 430 | // Save cookie in Output object |
| 431 | 431 | // added by ci-phpunit-test |
| 432 | - $CI =& get_instance(); |
|
| 432 | + $CI = & get_instance(); |
|
| 433 | 433 | $output = $CI->output; |
| 434 | 434 | $output->_cookies[$prefix.$name][] = [ |
| 435 | 435 | 'value' => $value, |
@@ -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, |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | |
| 264 | 264 | // Save status code in Output object |
| 265 | 265 | // added by ci-phpunit-test |
| 266 | - $CI =& get_instance(); |
|
| 266 | + $CI = & get_instance(); |
|
| 267 | 267 | $output = $CI->output; |
| 268 | 268 | $output->_status = [ |
| 269 | 269 | 'code' => $code, |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | if (empty($_config)) |
| 377 | 377 | { |
| 378 | 378 | // references cannot be directly assigned to static variables, so we use an array |
| 379 | - $_config[0] =& get_config(); |
|
| 379 | + $_config[0] = & get_config(); |
|
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | return isset($_config[0][$item]) ? $_config[0][$item] : NULL; |