@@ -69,7 +69,7 @@ discard block |
||
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 |
||
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 |
||
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; |
@@ -43,8 +43,7 @@ discard block |
||
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 |
||
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 |
||
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 | } |
@@ -86,7 +86,7 @@ |
||
86 | 86 | break; |
87 | 87 | default: |
88 | 88 | throw new RuntimeException( |
89 | - 'Sorry, ' . $count . ' params not implemented yet' |
|
89 | + 'Sorry, '.$count.' params not implemented yet' |
|
90 | 90 | ); |
91 | 91 | } |
92 | 92 | } |
@@ -48,8 +48,7 @@ |
||
48 | 48 | if (! $constructor_args) |
49 | 49 | { |
50 | 50 | $mock->disableOriginalConstructor(); |
51 | - } |
|
52 | - elseif (is_array($constructor_args)) |
|
51 | + } elseif (is_array($constructor_args)) |
|
53 | 52 | { |
54 | 53 | $mock->setConstructorArgs($constructor_args); |
55 | 54 | } |
@@ -24,18 +24,18 @@ |
||
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 | } |
@@ -38,8 +38,7 @@ |
||
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 | } |
@@ -21,7 +21,7 @@ |
||
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 | }; |
@@ -29,16 +29,14 @@ |
||
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'; |
@@ -19,8 +19,8 @@ discard block |
||
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 |
||
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(); |
@@ -31,7 +31,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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; |
@@ -54,8 +54,7 @@ discard block |
||
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 |
||
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 |
||
108 | 106 | ) |
109 | 107 | { |
110 | 108 | $key = $normalized_name; |
111 | - } |
|
112 | - else |
|
109 | + } else |
|
113 | 110 | { |
114 | 111 | $key = 'HTTP_' . $normalized_name; |
115 | 112 | } |
@@ -9,10 +9,10 @@ discard block |
||
9 | 9 | */ |
10 | 10 | |
11 | 11 | // Autoloader for ci-phpunit-test |
12 | -require __DIR__ . '/CIPHPUnitTestAutoloader.php'; |
|
13 | -require __DIR__ . '/CIPHPUnitTestFileCache.php'; |
|
12 | +require __DIR__.'/CIPHPUnitTestAutoloader.php'; |
|
13 | +require __DIR__.'/CIPHPUnitTestFileCache.php'; |
|
14 | 14 | $cache = new CIPHPUnitTestFileCache( |
15 | - __DIR__ . '/tmp/cache/autoload.php' |
|
15 | + __DIR__.'/tmp/cache/autoload.php' |
|
16 | 16 | ); |
17 | 17 | $autoload_dirs = CIPHPUnitTest::getAutoloadDirs(); |
18 | 18 | $autoloader = new CIPHPUnitTestAutoloader($cache, $autoload_dirs); |
@@ -20,5 +20,5 @@ discard block |
||
20 | 20 | |
21 | 21 | // Register CodeIgniter's tests/mocks/autoloader.php |
22 | 22 | define('SYSTEM_PATH', BASEPATH); |
23 | -require APPPATH .'tests/mocks/autoloader.php'; |
|
23 | +require APPPATH.'tests/mocks/autoloader.php'; |
|
24 | 24 | spl_autoload_register('autoload'); |
@@ -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, |