Completed
Push — master ( 57eaac...84ae94 )
by Kenji
03:19 queued 12s
created
Installer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
      */
27 27
     private static function fixPath()
28 28
     {
29
-        $file = static::TEST_FOLDER . '/Bootstrap.php';
29
+        $file = 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,7 +41,7 @@  discard block
 block discarded – undo
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__).'/../..').'/');",
@@ -82,11 +82,11 @@  discard block
 block discarded – undo
82 82
         
83 83
         foreach ($iterator as $file) {
84 84
             if ($file->isDir()) {
85
-                @mkdir($dst . '/' . $iterator->getSubPathName());
85
+                @mkdir($dst.'/'.$iterator->getSubPathName());
86 86
             } else {
87
-                $success = copy($file, $dst . '/' . $iterator->getSubPathName());
87
+                $success = copy($file, $dst.'/'.$iterator->getSubPathName());
88 88
                 if ($success) {
89
-                    echo 'copied: ' . $dst . '/' . $iterator->getSubPathName() . PHP_EOL;
89
+                    echo 'copied: '.$dst.'/'.$iterator->getSubPathName().PHP_EOL;
90 90
                 }
91 91
             }
92 92
         }
Please login to merge, or discard this patch.
application/libraries/Seeder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 
17 17
 	public function __construct()
18 18
 	{
19
-		$this->CI =& get_instance();
19
+		$this->CI = & get_instance();
20 20
 		$this->CI->load->database();
21 21
 		$this->CI->load->dbforge();
22 22
 		$this->db = $this->CI->db;
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 */
31 31
 	public function call($seeder)
32 32
 	{
33
-		$file = APPPATH . 'database/seeds/' . $seeder . '.php';
33
+		$file = APPPATH.'database/seeds/'.$seeder.'.php';
34 34
 		require_once $file;
35 35
 		$obj = new $seeder;
36 36
 		$obj->run();
Please login to merge, or discard this patch.
application/tests/Bootstrap.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
  * NOTE: If you change these, also change the error_reporting() code below
55 55
  */
56 56
 // This is needed for @runInSeparateProcess
57
-if (! defined('ENVIRONMENT'))
57
+if ( ! defined('ENVIRONMENT'))
58 58
 {
59 59
 	define('ENVIRONMENT', 'testing');
60 60
 }
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
  *  Added for CI PHPUnit Test
328 328
  * -------------------------------------------------------------------
329 329
  */
330
-require __DIR__ . '/_ci_phpunit_test/CIPHPUnitTest.php';
330
+require __DIR__.'/_ci_phpunit_test/CIPHPUnitTest.php';
331 331
 CIPHPUnitTest::init();
332 332
 /*
333 333
  * Or you can set directories for autoloading
Please login to merge, or discard this patch.
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -80,8 +80,7 @@  discard block
 block discarded – undo
80 80
 		if (version_compare(PHP_VERSION, '5.3', '>='))
81 81
 		{
82 82
 			error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
83
-		}
84
-		else
83
+		} else
85 84
 		{
86 85
 			error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE);
87 86
 		}
@@ -203,8 +202,7 @@  discard block
 block discarded – undo
203 202
 	if (($_temp = realpath($system_path)) !== FALSE)
204 203
 	{
205 204
 		$system_path = $_temp.'/';
206
-	}
207
-	else
205
+	} else
208 206
 	{
209 207
 		// Ensure there's a trailing slash
210 208
 		$system_path = rtrim($system_path, '/').'/';
@@ -244,8 +242,7 @@  discard block
 block discarded – undo
244 242
 		}
245 243
 
246 244
 		define('APPPATH', $application_folder.DIRECTORY_SEPARATOR);
247
-	}
248
-	else
245
+	} else
249 246
 	{
250 247
 		if ( ! is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR))
251 248
 		{
@@ -263,14 +260,12 @@  discard block
 block discarded – undo
263 260
 		if ( ! empty($view_folder) && is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
264 261
 		{
265 262
 			$view_folder = APPPATH.$view_folder;
266
-		}
267
-		elseif ( ! is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
263
+		} elseif ( ! is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
268 264
 		{
269 265
 			header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
270 266
 			echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
271 267
 			exit(3); // EXIT_CONFIG
272
-		}
273
-		else
268
+		} else
274 269
 		{
275 270
 			$view_folder = APPPATH.'views';
276 271
 		}
@@ -279,8 +274,7 @@  discard block
 block discarded – undo
279 274
 	if (($_temp = realpath($view_folder)) !== FALSE)
280 275
 	{
281 276
 		$view_folder = $_temp.DIRECTORY_SEPARATOR;
282
-	}
283
-	else
277
+	} else
284 278
 	{
285 279
 		$view_folder = rtrim($view_folder, '/\\').DIRECTORY_SEPARATOR;
286 280
 	}
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTestAutoloader.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	{
70 70
 		if (in_array($class, $this->alias))
71 71
 		{
72
-			$dir = __DIR__ . '/alias';
72
+			$dir = __DIR__.'/alias';
73 73
 			$this->loadClassFile($dir, $class);
74 74
 		}
75 75
 	}
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 		}
89 89
 		else
90 90
 		{
91
-			$dir = __DIR__ . '/exceptions';
91
+			$dir = __DIR__.'/exceptions';
92 92
 			$this->loadClassFile($dir, $class);
93 93
 		}
94 94
 	}
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
 	protected function loadClassFile($dir, $class)
131 131
 	{
132
-		$class_file = $dir . '/' . $class . '.php';
132
+		$class_file = $dir.'/'.$class.'.php';
133 133
 		if (file_exists($class_file))
134 134
 		{
135 135
 			require $class_file;
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,8 +43,7 @@  discard block
 block discarded – undo
43 43
 				APPPATH.'controllers',
44 44
 				APPPATH.'modules',
45 45
 			];
46
-		}
47
-		else
46
+		} else
48 47
 		{
49 48
 			$this->dirs = $dirs;
50 49
 		}
@@ -85,8 +84,7 @@  discard block
 block discarded – undo
85 84
 		{
86 85
 			$dir = __DIR__;
87 86
 			$this->loadClassFile($dir, $class);
88
-		}
89
-		else
87
+		} else
90 88
 		{
91 89
 			$dir = __DIR__ . '/exceptions';
92 90
 			$this->loadClassFile($dir, $class);
@@ -151,8 +149,7 @@  discard block
 block discarded – undo
151 149
 			{
152 150
 				require $filename;
153 151
 				return true;
154
-			}
155
-			else
152
+			} else
156 153
 			{
157 154
 				unset($this->cache[$class]);
158 155
 			}
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTestFileCache.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,18 +24,18 @@
 block discarded – undo
24 24
 		}
25 25
 
26 26
 		$dir = dirname($this->file);
27
-		if (! is_dir($dir))
27
+		if ( ! is_dir($dir))
28 28
 		{
29 29
 			if (@mkdir($dir, 0777, true) === false)
30 30
 			{
31
-				throw new RuntimeException('Failed to create folder: ' . $dir);
31
+				throw new RuntimeException('Failed to create folder: '.$dir);
32 32
 			}
33 33
 		}
34 34
 
35 35
 		if (file_put_contents($this->file, '') === false)
36 36
 		{
37 37
 			throw new RuntimeException(
38
-				'Failed to write to cache file: ' . $this->file
38
+				'Failed to write to cache file: '.$this->file
39 39
 			);
40 40
 		}
41 41
 	}
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,8 +38,7 @@
 block discarded – undo
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
 		}
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTestReflection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 		$ref_method->setAccessible(true);
22 22
 		$obj = (gettype($obj) === 'object') ? $obj : null;
23 23
 
24
-		return function () use ($obj, $ref_method) {
24
+		return function() use ($obj, $ref_method) {
25 25
 			$args = func_get_args();
26 26
 			return $ref_method->invokeArgs($obj, $args);
27 27
 		};
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTestRequest.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -129,8 +129,7 @@  discard block
 block discarded – undo
129 129
 				return $this->callControllerMethod(
130 130
 					$http_method, $argv, $params
131 131
 				);
132
-			}
133
-			else
132
+			} else
134 133
 			{
135 134
 				return $this->requestUri($http_method, $argv, $params);
136 135
 			}
@@ -141,8 +140,7 @@  discard block
 block discarded – undo
141 140
 			if ($e->getCode() === 0)
142 141
 			{
143 142
 				set_status_header(200);
144
-			}
145
-			else
143
+			} else
146 144
 			{
147 145
 				set_status_header($e->getCode());
148 146
 			}
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	public function enableHooks()
96 96
 	{
97 97
 		$this->enableHooks = true;
98
-		$this->hooks =& load_class('Hooks', 'core');
98
+		$this->hooks = & load_class('Hooks', 'core');
99 99
 	}
100 100
 
101 101
 	/**
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 			{
142 142
 				set_status_header($e->getCode());
143 143
 			}
144
-			$CI =& get_instance();
144
+			$CI = & get_instance();
145 145
 			$CI->output->_status['redirect'] = $e->getMessage();
146 146
 		}
147 147
 		// show_404()
@@ -197,17 +197,17 @@  discard block
 block discarded – undo
197 197
 		$this->setRawInputStream($request_params);
198 198
 
199 199
 		// 404 checking
200
-		if (! class_exists($class) || ! method_exists($class, $method))
200
+		if ( ! class_exists($class) || ! method_exists($class, $method))
201 201
 		{
202 202
 			// If 404, CodeIgniter instance is not created yet. So create it here
203 203
 			// Because we need CI->output->_status to store info
204
-			$CI =& get_instance();
204
+			$CI = & get_instance();
205 205
 			if ($CI === null)
206 206
 			{
207 207
 				new CI_Controller();
208 208
 			}
209 209
 
210
-			show_404($class.'::'.$method . '() is not found');
210
+			show_404($class.'::'.$method.'() is not found');
211 211
 		}
212 212
 
213 213
 		$params = $argv;
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 	{
267 267
 		if (is_string($string))
268 268
 		{
269
-			$INPUT =& load_class('Input', 'core');
269
+			$INPUT = & load_class('Input', 'core');
270 270
 			CIPHPUnitTestReflection::setPrivateProperty(
271 271
 				$INPUT,
272 272
 				'_raw_input_stream',
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 
291 291
 		// Create controller
292 292
 		$controller = new $class;
293
-		$CI =& get_instance();
293
+		$CI = & get_instance();
294 294
 
295 295
 		// Set CodeIgniter instance to TestCase
296 296
 		$this->testCase->setCI($CI);
@@ -330,8 +330,8 @@  discard block
 block discarded – undo
330 330
 	 */
331 331
 	public function getStatus()
332 332
 	{
333
-		$CI =& get_instance();
334
-		if (! isset($CI->output->_status))
333
+		$CI = & get_instance();
334
+		if ( ! isset($CI->output->_status))
335 335
 		{
336 336
 			throw new LogicException('Status code is not set. You must call $this->request() first');
337 337
 		}
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTestRouter.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,16 +29,14 @@
 block discarded – undo
29 29
 		if (empty($class) OR ! file_exists(APPPATH.'controllers/'.$RTR->directory.$class.'.php'))
30 30
 		{
31 31
 			$e404 = TRUE;
32
-		}
33
-		else
32
+		} else
34 33
 		{
35 34
 			require_once(APPPATH.'controllers/'.$RTR->directory.$class.'.php');
36 35
 
37 36
 			if ( ! class_exists($class, FALSE) OR $method[0] === '_' OR method_exists('CI_Controller', $method))
38 37
 			{
39 38
 				$e404 = TRUE;
40
-			}
41
-			elseif (method_exists($class, '_remap'))
39
+			} elseif (method_exists($class, '_remap'))
42 40
 			{
43 41
 				$params = array($method, array_slice($URI->rsegments, 2));
44 42
 				$method = '_remap';
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
 	 */
20 20
 	public function getRoute()
21 21
 	{
22
-		$RTR =& load_class('Router', 'core');
23
-		$URI =& load_class('URI', 'core');
22
+		$RTR = & load_class('Router', 'core');
23
+		$URI = & load_class('URI', 'core');
24 24
 
25 25
 		$e404 = FALSE;
26 26
 		$class = ucfirst($RTR->class);
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		{
58 58
 			// If 404, CodeIgniter instance is not created yet. So create it here.
59 59
 			// Because we need $this->CI->output->_status
60
-			$CI =& get_instance();
60
+			$CI = & get_instance();
61 61
 			if ($CI === null)
62 62
 			{
63 63
 				new CI_Controller();
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTestSuperGlobal.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 				// Set $_GET if URI string has query string
32 32
 				parse_str($query_string, $_GET);
33 33
 				// Remove query string from URI string
34
-				$argv = substr($argv, 0, -strlen($query_string)-1);
34
+				$argv = substr($argv, 0, -strlen($query_string) - 1);
35 35
 			}
36 36
 		}
37 37
 
@@ -64,12 +64,12 @@  discard block
 block discarded – undo
64 64
 		if ($_GET !== [])
65 65
 		{
66 66
 			$_SERVER['REQUEST_URI'] =
67
-				'/' . $path . '?'
67
+				'/'.$path.'?'
68 68
 				. http_build_query($_GET);
69 69
 		}
70 70
 		else
71 71
 		{
72
-			$_SERVER['REQUEST_URI'] = '/' . $path;
72
+			$_SERVER['REQUEST_URI'] = '/'.$path;
73 73
 		}
74 74
 	}
75 75
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
 		if ($query_string === false)
88 88
 		{
89
-			throw new LogicException('Bad URI string: ' . $uri);
89
+			throw new LogicException('Bad URI string: '.$uri);
90 90
 		}
91 91
 
92 92
 		return $query_string;
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 		}
112 112
 		else
113 113
 		{
114
-			$key = 'HTTP_' . $normalized_name;
114
+			$key = 'HTTP_'.$normalized_name;
115 115
 		}
116 116
 
117 117
 		$_SERVER[$key] = $value;
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -54,8 +54,7 @@  discard block
 block discarded – undo
54 54
 		if (is_string($argv))
55 55
 		{
56 56
 			$path = $argv;
57
-		}
58
-		elseif (is_array($argv))
57
+		} elseif (is_array($argv))
59 58
 		{
60 59
 			// Generate URI path from array of controller, method, arg, ...
61 60
 			$path = implode('/', $argv);
@@ -66,8 +65,7 @@  discard block
 block discarded – undo
66 65
 			$_SERVER['REQUEST_URI'] =
67 66
 				'/' . $path . '?'
68 67
 				. http_build_query($_GET);
69
-		}
70
-		else
68
+		} else
71 69
 		{
72 70
 			$_SERVER['REQUEST_URI'] = '/' . $path;
73 71
 		}
@@ -108,8 +106,7 @@  discard block
 block discarded – undo
108 106
 		)
109 107
 		{
110 108
 			$key = $normalized_name;
111
-		}
112
-		else
109
+		} else
113 110
 		{
114 111
 			$key = 'HTTP_' . $normalized_name;
115 112
 		}
Please login to merge, or discard this patch.