@@ -10,8 +10,8 @@ |
||
| 10 | 10 | |
| 11 | 11 | namespace Kenjis\MonkeyPatch\Patcher; |
| 12 | 12 | |
| 13 | -require __DIR__ . '/ConstantPatcher/NodeVisitor.php'; |
|
| 14 | -require __DIR__ . '/ConstantPatcher/Proxy.php'; |
|
| 13 | +require __DIR__.'/ConstantPatcher/NodeVisitor.php'; |
|
| 14 | +require __DIR__.'/ConstantPatcher/Proxy.php'; |
|
| 15 | 15 | |
| 16 | 16 | use LogicException; |
| 17 | 17 | |
@@ -173,13 +173,11 @@ |
||
| 173 | 173 | if (is_string($token)) |
| 174 | 174 | { |
| 175 | 175 | $new_source .= $token; |
| 176 | - } |
|
| 177 | - elseif ($i == $replacement['key']) |
|
| 176 | + } elseif ($i == $replacement['key']) |
|
| 178 | 177 | { |
| 179 | 178 | $new_source .= $replacement['value']; |
| 180 | 179 | $replacement = each(self::$replacement); |
| 181 | - } |
|
| 182 | - else |
|
| 180 | + } else |
|
| 183 | 181 | { |
| 184 | 182 | $new_source .= $token[1]; |
| 185 | 183 | } |
@@ -38,12 +38,12 @@ |
||
| 38 | 38 | $real_path = realpath($path); |
| 39 | 39 | if ($real_path === FALSE) |
| 40 | 40 | { |
| 41 | - throw new RuntimeException($path . ' does not exist?'); |
|
| 41 | + throw new RuntimeException($path.' does not exist?'); |
|
| 42 | 42 | } |
| 43 | 43 | if (is_dir($real_path)) |
| 44 | 44 | { |
| 45 | 45 | // Must use DIRECTORY_SEPARATOR for Windows |
| 46 | - $real_path = $real_path . DIRECTORY_SEPARATOR; |
|
| 46 | + $real_path = $real_path.DIRECTORY_SEPARATOR; |
|
| 47 | 47 | } |
| 48 | 48 | $new_paths[] = $excluded ? '-'.$real_path : $real_path; |
| 49 | 49 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | { |
| 36 | 36 | if ($this->db === null) |
| 37 | 37 | { |
| 38 | - $CI =& get_instance(); |
|
| 38 | + $CI = & get_instance(); |
|
| 39 | 39 | $CI->load->database(); |
| 40 | 40 | $this->db = $CI->db; |
| 41 | 41 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | protected function tearDown() |
| 56 | 56 | { |
| 57 | - if (! empty($this->insertCache)) |
|
| 57 | + if ( ! empty($this->insertCache)) |
|
| 58 | 58 | { |
| 59 | 59 | foreach ($this->insertCache as $row) |
| 60 | 60 | { |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | public function __construct() |
| 19 | 19 | { |
| 20 | - $this->CI =& get_instance(); |
|
| 20 | + $this->CI = & get_instance(); |
|
| 21 | 21 | $this->CI->load->database(); |
| 22 | 22 | $this->CI->load->dbforge(); |
| 23 | 23 | $this->db = $this->CI->db; |
@@ -33,10 +33,10 @@ discard block |
||
| 33 | 33 | { |
| 34 | 34 | if ($this->seedPath === null) |
| 35 | 35 | { |
| 36 | - $this->seedPath = APPPATH . 'database/seeds/'; |
|
| 36 | + $this->seedPath = APPPATH.'database/seeds/'; |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - $file = $this->seedPath . $seeder . '.php'; |
|
| 39 | + $file = $this->seedPath.$seeder.'.php'; |
|
| 40 | 40 | require_once $file; |
| 41 | 41 | |
| 42 | 42 | $obj = new $seeder; |
@@ -67,8 +67,7 @@ discard block |
||
| 67 | 67 | if ($filename === '' OR $data === '') |
| 68 | 68 | { |
| 69 | 69 | return; |
| 70 | - } |
|
| 71 | - elseif ($data === NULL) |
|
| 70 | + } elseif ($data === NULL) |
|
| 72 | 71 | { |
| 73 | 72 | if ( ! @is_file($filename) OR ($filesize = @filesize($filename)) === FALSE) |
| 74 | 73 | { |
@@ -78,8 +77,7 @@ discard block |
||
| 78 | 77 | $filepath = $filename; |
| 79 | 78 | $filename = explode('/', str_replace(DIRECTORY_SEPARATOR, '/', $filename)); |
| 80 | 79 | $filename = end($filename); |
| 81 | - } |
|
| 82 | - else |
|
| 80 | + } else |
|
| 83 | 81 | { |
| 84 | 82 | $filesize = strlen($data); |
| 85 | 83 | } |
@@ -158,8 +156,7 @@ discard block |
||
| 158 | 156 | if (ENVIRONMENT !== 'testing') |
| 159 | 157 | { |
| 160 | 158 | exit($data); |
| 161 | - } |
|
| 162 | - else |
|
| 159 | + } else |
|
| 163 | 160 | { |
| 164 | 161 | echo($data); |
| 165 | 162 | throw new CIPHPUnitTestExitException('exit() from force_download()'); |
@@ -176,8 +173,7 @@ discard block |
||
| 176 | 173 | if (ENVIRONMENT !== 'testing') |
| 177 | 174 | { |
| 178 | 175 | exit; |
| 179 | - } |
|
| 180 | - else |
|
| 176 | + } else |
|
| 181 | 177 | { |
| 182 | 178 | throw new CIPHPUnitTestExitException('exit() from force_download()'); |
| 183 | 179 | } |
@@ -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'); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | return $this->$name; |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - throw new LogicException('No such property: ' . $name); |
|
| 52 | + throw new LogicException('No such property: '.$name); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | public static function setUpBeforeClass() |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | { |
| 73 | 73 | reset_instance(); |
| 74 | 74 | CIPHPUnitTest::createCodeIgniterInstance(); |
| 75 | - $this->CI =& get_instance(); |
|
| 75 | + $this->CI = & get_instance(); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | { |
| 86 | 86 | reset_instance(); |
| 87 | 87 | $controller = new $classname; |
| 88 | - $this->CI =& get_instance(); |
|
| 88 | + $this->CI = & get_instance(); |
|
| 89 | 89 | return $controller; |
| 90 | 90 | } |
| 91 | 91 | |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | $this->assertSame( |
| 267 | 267 | $code, |
| 268 | 268 | $actual, |
| 269 | - 'Status code is not ' . $code . ' but ' . $actual . '.' |
|
| 269 | + 'Status code is not '.$code.' but '.$actual.'.' |
|
| 270 | 270 | ); |
| 271 | 271 | } |
| 272 | 272 | |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | */ |
| 279 | 279 | public function assertResponseHeader($name, $value) |
| 280 | 280 | { |
| 281 | - $CI =& get_instance(); |
|
| 281 | + $CI = & get_instance(); |
|
| 282 | 282 | $actual = $CI->output->get_header($name); |
| 283 | 283 | |
| 284 | 284 | if ($actual === null) |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | */ |
| 303 | 303 | public function assertResponseCookie($name, $value, $allow_duplicate = false) |
| 304 | 304 | { |
| 305 | - $CI =& get_instance(); |
|
| 305 | + $CI = & get_instance(); |
|
| 306 | 306 | $cookies = isset($CI->output->_cookies[$name]) |
| 307 | 307 | ? $CI->output->_cookies[$name] : null; |
| 308 | 308 | |
@@ -360,23 +360,23 @@ discard block |
||
| 360 | 360 | $this->fail('redirect() is not called.'); |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | - if (! function_exists('site_url')) |
|
| 363 | + if ( ! function_exists('site_url')) |
|
| 364 | 364 | { |
| 365 | - $CI =& get_instance(); |
|
| 365 | + $CI = & get_instance(); |
|
| 366 | 366 | $CI->load->helper('url'); |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | - if (! preg_match('#^(\w+:)?//#i', $uri)) |
|
| 369 | + if ( ! preg_match('#^(\w+:)?//#i', $uri)) |
|
| 370 | 370 | { |
| 371 | 371 | $uri = site_url($uri); |
| 372 | 372 | } |
| 373 | 373 | $absolute_url = $uri; |
| 374 | - $expected = 'Redirect to ' . $absolute_url; |
|
| 374 | + $expected = 'Redirect to '.$absolute_url; |
|
| 375 | 375 | |
| 376 | 376 | $this->assertSame( |
| 377 | 377 | $expected, |
| 378 | 378 | $status['redirect'], |
| 379 | - 'URL to redirect is not ' . $expected . ' but ' . $status['redirect'] . '.' |
|
| 379 | + 'URL to redirect is not '.$expected.' but '.$status['redirect'].'.' |
|
| 380 | 380 | ); |
| 381 | 381 | |
| 382 | 382 | if ($code !== null) |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | $this->assertSame( |
| 385 | 385 | $code, |
| 386 | 386 | $status['code'], |
| 387 | - 'Status code is not ' . $code . ' but ' . $status['code'] . '.' |
|
| 387 | + 'Status code is not '.$code.' but '.$status['code'].'.' |
|
| 388 | 388 | ); |
| 389 | 389 | } |
| 390 | 390 | } |