Completed
Push — master ( 32defb...a4f8ce )
by Kenji
02:23
created
application/tests/_ci_phpunit_test/replacing/core/Common.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 	if ($_log === NULL)
202 202
 	{
203 203
 		// references cannot be directly assigned to static variables, so we use an array
204
-		$_log[0] =& load_class('Log', 'core');
204
+		$_log[0] = & load_class('Log', 'core');
205 205
 	}
206 206
 
207 207
 	$_log[0]->write_log($level, $message);
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 
292 292
 	// Save status code in Output object
293 293
 	// added by ci-phpunit-test
294
-	$CI =& get_instance();
294
+	$CI = & get_instance();
295 295
 	$output = $CI->output;
296 296
 	$output->_status = [
297 297
 		'code'     => $code,
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 	if (empty($_config))
406 406
 	{
407 407
 		// references cannot be directly assigned to static variables, so we use an array
408
-		$_config[0] =& get_config();
408
+		$_config[0] = & get_config();
409 409
 	}
410 410
 
411 411
 	return isset($_config[0][$item]) ? $_config[0][$item] : NULL;
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTest.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -43,26 +43,26 @@  discard block
 block discarded – undo
43 43
 		$cwd_backup = getcwd();
44 44
 
45 45
 		// Load autoloader for ci-phpunit-test
46
-		require __DIR__ . '/autoloader.php';
46
+		require __DIR__.'/autoloader.php';
47 47
 
48 48
 		self::loadTestCaseClasses();
49 49
 
50 50
 		// Replace a few Common functions
51
-		require __DIR__ . '/replacing/core/Common.php';
52
-		require BASEPATH . 'core/Common.php';
51
+		require __DIR__.'/replacing/core/Common.php';
52
+		require BASEPATH.'core/Common.php';
53 53
 
54 54
 		// Workaround for missing CodeIgniter's error handler
55 55
 		// See https://github.com/kenjis/ci-phpunit-test/issues/37
56 56
 		set_error_handler('_error_handler');
57 57
 
58 58
 		// Load new functions of CIPHPUnitTest
59
-		require __DIR__ . '/functions.php';
59
+		require __DIR__.'/functions.php';
60 60
 		// Load ci-phpunit-test CI_Loader
61
-		require __DIR__ . '/replacing/core/Loader.php';
61
+		require __DIR__.'/replacing/core/Loader.php';
62 62
 		// Load ci-phpunit-test CI_Input
63
-		require __DIR__ . '/replacing/core/Input.php';
63
+		require __DIR__.'/replacing/core/Input.php';
64 64
 		// Load ci-phpunit-test CI_Output
65
-		require __DIR__ . '/replacing/core/Output.php';
65
+		require __DIR__.'/replacing/core/Output.php';
66 66
 
67 67
 		// Change current directory
68 68
 		chdir(FCPATH);
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 		self::loadCodeIgniter();
71 71
 
72 72
 		// Create CodeIgniter instance
73
-		if (! self::wiredesignzHmvcInstalled())
73
+		if ( ! self::wiredesignzHmvcInstalled())
74 74
 		{
75 75
 			new CI_Controller();
76 76
 		}
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 		chdir($cwd_backup);
93 93
 	}
94 94
 
95
-	private static function loadCodeIgniter(){
95
+	private static function loadCodeIgniter() {
96 96
 		// Load constants.php before replacing helpers,
97 97
 		// because config_item() loads config.php
98 98
 		if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/constants.php'))
@@ -115,31 +115,31 @@  discard block
 block discarded – undo
115 115
 		 *
116 116
 		 * And away we go...
117 117
 		 */
118
-		require __DIR__ . '/replacing/core/CodeIgniter.php';
118
+		require __DIR__.'/replacing/core/CodeIgniter.php';
119 119
 	}
120 120
 
121 121
 	private static function defineConstants()
122 122
 	{
123
-		if (! defined('TESTPATH')) {
123
+		if ( ! defined('TESTPATH')) {
124 124
 			define('TESTPATH', APPPATH.'tests'.DIRECTORY_SEPARATOR);
125 125
 		}
126 126
 		// Current Bootstrap.php should define this, but in case it doesn't:
127
-		if (! defined('CI_PHPUNIT_TESTPATH')) {
127
+		if ( ! defined('CI_PHPUNIT_TESTPATH')) {
128 128
 			define('CI_PHPUNIT_TESTPATH', dirname(__FILE__).DIRECTORY_SEPARATOR);
129 129
 		}
130 130
 	}
131 131
 
132 132
 	private static function loadTestCaseClasses()
133 133
 	{
134
-		require TESTPATH . 'TestCase.php';
134
+		require TESTPATH.'TestCase.php';
135 135
 
136
-		$db_test_case_file = TESTPATH . 'DbTestCase.php';
136
+		$db_test_case_file = TESTPATH.'DbTestCase.php';
137 137
 		if (is_readable($db_test_case_file))
138 138
 		{
139 139
 			require $db_test_case_file;
140 140
 		}
141 141
 
142
-		$unit_test_case_file = TESTPATH . 'UnitTestCase.php';
142
+		$unit_test_case_file = TESTPATH.'UnitTestCase.php';
143 143
 		if (is_readable($unit_test_case_file))
144 144
 		{
145 145
 			require $unit_test_case_file;
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 	 */
152 152
 	public static function createCodeIgniterInstance($use_my_controller = false)
153 153
 	{
154
-		if (! self::wiredesignzHmvcInstalled())
154
+		if ( ! self::wiredesignzHmvcInstalled())
155 155
 		{
156 156
 			if ($use_my_controller && self::hasMyController())
157 157
 			{
@@ -176,11 +176,11 @@  discard block
 block discarded – undo
176 176
 		}
177 177
 
178 178
 		$my_controller_file =
179
-			APPPATH . 'core/' . config_item('subclass_prefix') . 'Controller.php';
179
+			APPPATH.'core/'.config_item('subclass_prefix').'Controller.php';
180 180
 
181 181
 		if (file_exists($my_controller_file))
182 182
 		{
183
-			$controller_class = config_item('subclass_prefix') . 'Controller';
183
+			$controller_class = config_item('subclass_prefix').'Controller';
184 184
 			if ( ! class_exists($controller_class))
185 185
 			{
186 186
 				require $my_controller_file;
@@ -212,11 +212,11 @@  discard block
 block discarded – undo
212 212
 	protected static function replaceLoader()
213 213
 	{
214 214
 		$my_loader_file =
215
-			APPPATH . 'core/' . config_item('subclass_prefix') . 'Loader.php';
215
+			APPPATH.'core/'.config_item('subclass_prefix').'Loader.php';
216 216
 
217 217
 		if (file_exists($my_loader_file))
218 218
 		{
219
-			self::$loader_class = config_item('subclass_prefix') . 'Loader';
219
+			self::$loader_class = config_item('subclass_prefix').'Loader';
220 220
 			if ( ! class_exists(self::$loader_class))
221 221
 			{
222 222
 				require $my_loader_file;
@@ -228,11 +228,11 @@  discard block
 block discarded – undo
228 228
 	protected static function replaceConfig()
229 229
 	{
230 230
 		$my_config_file =
231
-			APPPATH . 'core/' . config_item('subclass_prefix') . 'Config.php';
231
+			APPPATH.'core/'.config_item('subclass_prefix').'Config.php';
232 232
 
233 233
 		if (file_exists($my_config_file))
234 234
 		{
235
-			self::$config_class = config_item('subclass_prefix') . 'Config';
235
+			self::$config_class = config_item('subclass_prefix').'Config';
236 236
 			if ( ! class_exists(self::$config_class))
237 237
 			{
238 238
 				require $my_config_file;
@@ -251,19 +251,19 @@  discard block
 block discarded – undo
251 251
 
252 252
 	protected static function loadHelper($helper)
253 253
 	{
254
-		$my_helper_file = APPPATH . 'helpers/' . config_item('subclass_prefix') . $helper . '.php';
254
+		$my_helper_file = APPPATH.'helpers/'.config_item('subclass_prefix').$helper.'.php';
255 255
 		if (file_exists($my_helper_file))
256 256
 		{
257 257
 			require $my_helper_file;
258 258
 		}
259
-		require __DIR__ . '/replacing/helpers/' . $helper . '.php';
259
+		require __DIR__.'/replacing/helpers/'.$helper.'.php';
260 260
 	}
261 261
 
262 262
 	public static function setPatcherCacheDir($dir = null)
263 263
 	{
264 264
 		if ($dir === null)
265 265
 		{
266
-			$dir = CI_PHPUNIT_TESTPATH . 'tmp/cache';
266
+			$dir = CI_PHPUNIT_TESTPATH.'tmp/cache';
267 267
 		}
268 268
 
269 269
 		MonkeyPatchManager::setCacheDir(
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 
280 280
 	public static function loadConfig()
281 281
 	{
282
-		$config= new self::$config_class;
282
+		$config = new self::$config_class;
283 283
 		load_class_instance('Config', $config);
284 284
 	}
285 285
 }
Please login to merge, or discard this patch.
application/tests/Bootstrap.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 	define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
244 244
 
245 245
 	// Path to the test directory containing all the test files.
246
-	define('TESTPATH', __DIR__.DIRECTORY_SEPARATOR);  // Should be the folder this `Bootstrap.php` file is in.
246
+	define('TESTPATH', __DIR__.DIRECTORY_SEPARATOR); // Should be the folder this `Bootstrap.php` file is in.
247 247
 
248 248
 	// Path to the system directory
249 249
 	define('BASEPATH', $system_path);
@@ -325,9 +325,9 @@  discard block
 block discarded – undo
325 325
 	define('VIEWPATH', $view_folder.DIRECTORY_SEPARATOR);
326 326
 
327 327
 	// Path to the ci-phpunit-test directory
328
-	if (is_file(TESTPATH . '_ci_phpunit_test' . DIRECTORY_SEPARATOR . 'CIPHPUnitTest.php'))
328
+	if (is_file(TESTPATH.'_ci_phpunit_test'.DIRECTORY_SEPARATOR.'CIPHPUnitTest.php'))
329 329
 	{
330
-		define('CI_PHPUNIT_TESTPATH', TESTPATH . '_ci_phpunit_test' . DIRECTORY_SEPARATOR);
330
+		define('CI_PHPUNIT_TESTPATH', TESTPATH.'_ci_phpunit_test'.DIRECTORY_SEPARATOR);
331 331
 	}
332 332
 	else
333 333
 	{
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
  * -------------------------------------------------------------------
389 389
  */
390 390
 
391
-require CI_PHPUNIT_TESTPATH . '/CIPHPUnitTest.php';
391
+require CI_PHPUNIT_TESTPATH.'/CIPHPUnitTest.php';
392 392
 
393 393
 CIPHPUnitTest::init();
394 394
 // Or you can set directories for autoloading
Please login to merge, or discard this patch.
tests/_ci_phpunit_test/replacing/helpers/old/3.1.9-download_helper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 			}
73 73
 
74 74
 			// Load the mime types
75
-			$mimes =& get_mimes();
75
+			$mimes = & get_mimes();
76 76
 
77 77
 			// Only change the default MIME if we can find one
78 78
 			if (isset($mimes[$extension]))
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 
118 118
 		if (TestCase::isTestingEnv())
119 119
 		{
120
-			$CI =& get_instance();
120
+			$CI = & get_instance();
121 121
 			$CI->output->set_header('Content-Type: '.$mime);
122 122
 			$CI->output->set_header('Content-Disposition: attachment; filename="'.$filename.'"');
123 123
 			$CI->output->set_header('Expires: 0');
Please login to merge, or discard this patch.
tests/_ci_phpunit_test/replacing/helpers/old/3.1.8-download_helper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 			}
73 73
 
74 74
 			// Load the mime types
75
-			$mimes =& get_mimes();
75
+			$mimes = & get_mimes();
76 76
 
77 77
 			// Only change the default MIME if we can find one
78 78
 			if (isset($mimes[$extension]))
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 
118 118
 		if (TestCase::isTestingEnv())
119 119
 		{
120
-			$CI =& get_instance();
120
+			$CI = & get_instance();
121 121
 			$CI->output->set_header('Content-Type: '.$mime);
122 122
 			$CI->output->set_header('Content-Disposition: attachment; filename="'.$filename.'"');
123 123
 			$CI->output->set_header('Expires: 0');
Please login to merge, or discard this patch.
tests/_ci_phpunit_test/replacing/helpers/old/3.1.7-download_helper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 			}
73 73
 
74 74
 			// Load the mime types
75
-			$mimes =& get_mimes();
75
+			$mimes = & get_mimes();
76 76
 
77 77
 			// Only change the default MIME if we can find one
78 78
 			if (isset($mimes[$extension]))
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 
118 118
 		if (TestCase::isTestingEnv())
119 119
 		{
120
-			$CI =& get_instance();
120
+			$CI = & get_instance();
121 121
 			$CI->output->set_header('Content-Type: '.$mime);
122 122
 			$CI->output->set_header('Content-Disposition: attachment; filename="'.$filename.'"');
123 123
 			$CI->output->set_header('Expires: 0');
Please login to merge, or discard this patch.
tests/_ci_phpunit_test/replacing/helpers/old/3.1.6-download_helper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 			}
73 73
 
74 74
 			// Load the mime types
75
-			$mimes =& get_mimes();
75
+			$mimes = & get_mimes();
76 76
 
77 77
 			// Only change the default MIME if we can find one
78 78
 			if (isset($mimes[$extension]))
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 
118 118
 		if (TestCase::isTestingEnv())
119 119
 		{
120
-			$CI =& get_instance();
120
+			$CI = & get_instance();
121 121
 			$CI->output->set_header('Content-Type: '.$mime);
122 122
 			$CI->output->set_header('Content-Disposition: attachment; filename="'.$filename.'"');
123 123
 			$CI->output->set_header('Expires: 0');
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/replacing/helpers/download_helper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 			}
73 73
 
74 74
 			// Load the mime types
75
-			$mimes =& get_mimes();
75
+			$mimes = & get_mimes();
76 76
 
77 77
 			// Only change the default MIME if we can find one
78 78
 			if (isset($mimes[$extension]))
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 
118 118
 		if (TestCase::isTestingEnv())
119 119
 		{
120
-			$CI =& get_instance();
120
+			$CI = & get_instance();
121 121
 			$CI->output->set_header('Content-Type: '.$mime);
122 122
 			$CI->output->set_header('Content-Disposition: attachment; filename="'.$filename.'"');
123 123
 			$CI->output->set_header('Expires: 0');
Please login to merge, or discard this patch.
lib/Installer.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@  discard block
 block discarded – undo
11 11
 class Installer
12 12
 {
13 13
     private $silent = false;
14
-    private $app_dir = 'application';  // -a DIRECTORY
15
-    private $pub_dir = 'public';       // -p DIRECTORY
16
-    private $test_dir = null;          // -t DIRECTORY
14
+    private $app_dir = 'application'; // -a DIRECTORY
15
+    private $pub_dir = 'public'; // -p DIRECTORY
16
+    private $test_dir = null; // -t DIRECTORY
17 17
     private $from_composer = false;
18 18
 
19 19
     public function __construct($argv)
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         }
31 31
 
32 32
         for ($i = 1; $i <= $argc; $i++) {
33
-            if (! isset($argv[$i])) {
33
+            if ( ! isset($argv[$i])) {
34 34
                 break;
35 35
             }
36 36
 
@@ -42,29 +42,29 @@  discard block
 block discarded – undo
42 42
 
43 43
                 // php install.php -a application
44 44
                 case '-a':
45
-                    if (is_dir($argv[$i+1])) {
46
-                        $this->app_dir = $argv[$i+1];
45
+                    if (is_dir($argv[$i + 1])) {
46
+                        $this->app_dir = $argv[$i + 1];
47 47
                     } else {
48
-                        throw new Exception('No such application directory: '.$argv[$i+1]);
48
+                        throw new Exception('No such application directory: '.$argv[$i + 1]);
49 49
                     }
50 50
                     $i++;
51 51
                     break;
52 52
 
53 53
                 // php install.php -p public
54 54
                 case '-p':
55
-                    if (is_dir($argv[$i+1])) {
56
-                        $this->pub_dir = $argv[$i+1];
55
+                    if (is_dir($argv[$i + 1])) {
56
+                        $this->pub_dir = $argv[$i + 1];
57 57
                     } else {
58
-                        throw new Exception('No such public directory: '.$argv[$i+1]);
58
+                        throw new Exception('No such public directory: '.$argv[$i + 1]);
59 59
                     }
60 60
                     $i++;
61 61
                     break;
62 62
                 // php install.php -t application/tests
63 63
                 case '-t':
64
-                    if (is_dir($argv[$i+1])) {
65
-                        $this->test_dir = $argv[$i+1];
64
+                    if (is_dir($argv[$i + 1])) {
65
+                        $this->test_dir = $argv[$i + 1];
66 66
                     } else {
67
-                        throw new Exception('No such test directory: '.$argv[$i+1]);
67
+                        throw new Exception('No such test directory: '.$argv[$i + 1]);
68 68
                     }
69 69
                     $i++;
70 70
                     break;
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         $file = $this->test_dir.'/Bootstrap.php';
106 106
         $contents = file_get_contents($file);
107 107
 
108
-        if (! file_exists('system')) {
108
+        if ( ! file_exists('system')) {
109 109
             if (file_exists('vendor/codeigniter/framework/system')) {
110 110
                 $contents = str_replace(
111 111
                     '$system_path = \'../../system\';',
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
             }
118 118
         }
119 119
 
120
-        if (! file_exists('index.php')) {
120
+        if ( ! file_exists('index.php')) {
121 121
             if (file_exists($this->pub_dir.'/index.php')) {
122 122
                 // CodeIgniter 3.0.6 and after
123 123
                 $contents = str_replace(
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
             } else {
191 191
                 $success = copy($file, $dst.'/'.$iterator->getSubPathName());
192 192
                 if ($success) {
193
-                    if (! $this->silent) {
193
+                    if ( ! $this->silent) {
194 194
                         echo 'copied: '.$dst.'/'.$iterator->getSubPathName().PHP_EOL;
195 195
                     }
196 196
                 }
Please login to merge, or discard this patch.