@@ -8,7 +8,7 @@ |
||
8 | 8 | * @link https://github.com/kenjis/ci-phpunit-test |
9 | 9 | */ |
10 | 10 | |
11 | -require __DIR__ . '/Installer.php'; |
|
11 | +require __DIR__.'/Installer.php'; |
|
12 | 12 | |
13 | 13 | $installer = new Installer($argv); |
14 | 14 | $installer->install(); |
@@ -8,7 +8,7 @@ |
||
8 | 8 | * @link https://github.com/kenjis/ci-phpunit-test |
9 | 9 | */ |
10 | 10 | |
11 | -require __DIR__ . '/Installer.php'; |
|
11 | +require __DIR__.'/Installer.php'; |
|
12 | 12 | |
13 | 13 | $installer = new Installer($argv); |
14 | 14 | $installer->update(); |
@@ -30,7 +30,7 @@ discard block |
||
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,26 +42,26 @@ discard block |
||
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 directory: ' . $argv[$i+1]); |
|
48 | + throw new Exception('No such 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 directory: ' . $argv[$i+1]); |
|
58 | + throw new Exception('No such directory: '.$argv[$i + 1]); |
|
59 | 59 | } |
60 | 60 | $i++; |
61 | 61 | break; |
62 | 62 | |
63 | 63 | default: |
64 | - throw new Exception('Unknown argument: ' . $argv[$i]); |
|
64 | + throw new Exception('Unknown argument: '.$argv[$i]); |
|
65 | 65 | } |
66 | 66 | } |
67 | 67 | } |
@@ -69,8 +69,8 @@ discard block |
||
69 | 69 | public function install() |
70 | 70 | { |
71 | 71 | $this->recursiveCopy( |
72 | - dirname(__FILE__) . '/application/tests', |
|
73 | - $this->app . '/' . static::TEST_FOLDER |
|
72 | + dirname(__FILE__).'/application/tests', |
|
73 | + $this->app.'/'.static::TEST_FOLDER |
|
74 | 74 | ); |
75 | 75 | $this->fixPath($this->app, $this->pub); |
76 | 76 | } |
@@ -80,10 +80,10 @@ discard block |
||
80 | 80 | */ |
81 | 81 | private function fixPath() |
82 | 82 | { |
83 | - $file = $this->app . '/' . static::TEST_FOLDER . '/Bootstrap.php'; |
|
83 | + $file = $this->app.'/'.static::TEST_FOLDER.'/Bootstrap.php'; |
|
84 | 84 | $contents = file_get_contents($file); |
85 | 85 | |
86 | - if (! file_exists('system')) { |
|
86 | + if ( ! file_exists('system')) { |
|
87 | 87 | if (file_exists('vendor/codeigniter/framework/system')) { |
88 | 88 | $contents = str_replace( |
89 | 89 | '$system_path = \'../../system\';', |
@@ -95,8 +95,8 @@ discard block |
||
95 | 95 | } |
96 | 96 | } |
97 | 97 | |
98 | - if (! file_exists('index.php')) { |
|
99 | - if (file_exists($pub . '/index.php')) { |
|
98 | + if ( ! file_exists('index.php')) { |
|
99 | + if (file_exists($pub.'/index.php')) { |
|
100 | 100 | // CodeIgniter 3.0.6 and after |
101 | 101 | $contents = str_replace( |
102 | 102 | "define('FCPATH', realpath(dirname(__FILE__).'/../..').DIRECTORY_SEPARATOR);", |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | "define('FCPATH', realpath(dirname(__FILE__).'/../../' . $pub).'/');", |
110 | 110 | $contents |
111 | 111 | ); |
112 | - } elseif (file_exists($this->app . '/public/index.php')) { |
|
112 | + } elseif (file_exists($this->app.'/public/index.php')) { |
|
113 | 113 | // CodeIgniter 3.0.6 and after |
114 | 114 | $contents = str_replace( |
115 | 115 | "define('FCPATH', realpath(dirname(__FILE__).'/../..').DIRECTORY_SEPARATOR);", |
@@ -139,10 +139,10 @@ discard block |
||
139 | 139 | |
140 | 140 | public function update() |
141 | 141 | { |
142 | - $target_dir = $this->app . '/' . static::TEST_FOLDER . '/_ci_phpunit_test'; |
|
142 | + $target_dir = $this->app.'/'.static::TEST_FOLDER.'/_ci_phpunit_test'; |
|
143 | 143 | $this->recursiveUnlink($target_dir); |
144 | 144 | $this->recursiveCopy( |
145 | - dirname(__FILE__) . '/application/tests/_ci_phpunit_test', |
|
145 | + dirname(__FILE__).'/application/tests/_ci_phpunit_test', |
|
146 | 146 | $target_dir |
147 | 147 | ); |
148 | 148 | } |
@@ -164,12 +164,12 @@ discard block |
||
164 | 164 | |
165 | 165 | foreach ($iterator as $file) { |
166 | 166 | if ($file->isDir()) { |
167 | - @mkdir($dst . '/' . $iterator->getSubPathName()); |
|
167 | + @mkdir($dst.'/'.$iterator->getSubPathName()); |
|
168 | 168 | } else { |
169 | - $success = copy($file, $dst . '/' . $iterator->getSubPathName()); |
|
169 | + $success = copy($file, $dst.'/'.$iterator->getSubPathName()); |
|
170 | 170 | if ($success) { |
171 | - if (! $this->silent) { |
|
172 | - echo 'copied: ' . $dst . '/' . $iterator->getSubPathName() . PHP_EOL; |
|
171 | + if ( ! $this->silent) { |
|
172 | + echo 'copied: '.$dst.'/'.$iterator->getSubPathName().PHP_EOL; |
|
173 | 173 | } |
174 | 174 | } |
175 | 175 | } |