@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | protected static $_extension2type = [ |
111 | 111 | 'json' => 'json', |
112 | - 'yml' => 'yaml', /// first one is preferred |
|
112 | + 'yml' => 'yaml', /// first one is preferred |
|
113 | 113 | 'yaml' => 'yaml', |
114 | 114 | 'xml' => 'xml', |
115 | 115 | 'xml.dist' => 'xml', |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | |
159 | 159 | public function setBasename($basename) |
160 | 160 | { |
161 | - $this->setPath($this->_dirname . '/' . $basename); |
|
161 | + $this->setPath($this->_dirname.'/'.$basename); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | public function getBasename() |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | |
169 | 169 | public function setDirname($dirname) |
170 | 170 | { |
171 | - $this->setPath($dirname . '/' . $this->_basename); |
|
171 | + $this->setPath($dirname.'/'.$this->_basename); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | public function getDirname() |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | |
179 | 179 | public function setFilename($filename) |
180 | 180 | { |
181 | - $this->setPath($this->_dirname . '/' . $filename . '.' . $this->_extension); |
|
181 | + $this->setPath($this->_dirname.'/'.$filename.'.'.$this->_extension); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | public function getFilename() |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | |
189 | 189 | public function setExtension($extension) |
190 | 190 | { |
191 | - $this->setPath($this->_dirname . '/' . $this->_filename . '.' . $extension); |
|
191 | + $this->setPath($this->_dirname.'/'.$this->_filename.'.'.$extension); |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | public function getExtension() |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | { |
240 | 240 | if (!is_object($this->_handler)) { |
241 | 241 | $this->_handler = Yii::createObject([ |
242 | - 'class' => 'hidev\handlers\\' . $this->getCtype() . 'Handler', |
|
242 | + 'class' => 'hidev\handlers\\'.$this->getCtype().'Handler', |
|
243 | 243 | 'template' => $this->template, |
244 | 244 | 'goal' => $this->goal, |
245 | 245 | ]); |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | |
337 | 337 | public function chown($value) |
338 | 338 | { |
339 | - $ownergroup = $this->getOwner() . ':' . $this->getGroup(); |
|
339 | + $ownergroup = $this->getOwner().':'.$this->getGroup(); |
|
340 | 340 | if (in_array($value, [$ownergroup, $this->getOwner(), $this->getUid()], false)) { |
341 | 341 | return; |
342 | 342 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | public function renderPath($path, $data) |
25 | 25 | { |
26 | 26 | copy($data->getCopy(), $path); |
27 | - Yii::warning('Copied file: ' . $path); |
|
27 | + Yii::warning('Copied file: '.$path); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
@@ -66,16 +66,16 @@ |
||
66 | 66 | { |
67 | 67 | $path = parent::detectCommand($path); |
68 | 68 | |
69 | - return is_executable($path) ? $path : '/usr/bin/env php ' . $path; |
|
69 | + return is_executable($path) ? $path : '/usr/bin/env php '.$path; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | public function install() |
73 | 73 | { |
74 | 74 | if ($this->installer) { |
75 | - passthru('/usr/bin/env wget ' . escapeshellarg($this->installer) . ' -O- | /usr/bin/env php', $exitcode); |
|
75 | + passthru('/usr/bin/env wget '.escapeshellarg($this->installer).' -O- | /usr/bin/env php', $exitcode); |
|
76 | 76 | } elseif ($this->download) { |
77 | - $dest = Yii::getAlias('@root/' . $this->name . '.phar', false); |
|
78 | - passthru('/usr/bin/env wget ' . escapeshellarg($this->download) . ' -O ' . $dest, $exitcode); |
|
77 | + $dest = Yii::getAlias('@root/'.$this->name.'.phar', false); |
|
78 | + passthru('/usr/bin/env wget '.escapeshellarg($this->download).' -O '.$dest, $exitcode); |
|
79 | 79 | } else { |
80 | 80 | return parent::install(); |
81 | 81 | } |
@@ -65,14 +65,14 @@ discard block |
||
65 | 65 | { |
66 | 66 | $command = $this->getCommand(); |
67 | 67 | if (is_string($args)) { |
68 | - return $command . ' ' . trim($args); |
|
68 | + return $command.' '.trim($args); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | foreach ($args as $arg) { |
72 | 72 | if ($arg instanceof ModifierInterface) { |
73 | 73 | $command = $arg->modify($command); |
74 | 74 | } else { |
75 | - $command .= ' ' . escapeshellarg($arg); |
|
75 | + $command .= ' '.escapeshellarg($arg); |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | public function install() |
83 | 83 | { |
84 | - throw new InvalidConfigException('Don\'t know how to install ' . $this->name); |
|
84 | + throw new InvalidConfigException('Don\'t know how to install '.$this->name); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function detectPath($name) |
115 | 115 | { |
116 | - return exec('which ' . $name) ?: null; |
|
116 | + return exec('which '.$name) ?: null; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $path = $this->getPath(); |
149 | 149 | } |
150 | 150 | if (!$path || !file_exists($path)) { |
151 | - throw new InvalidConfigException('Failed to find how to run ' . $this->name); |
|
151 | + throw new InvalidConfigException('Failed to find how to run '.$this->name); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | return $path; |
@@ -36,7 +36,7 @@ |
||
36 | 36 | foreach ($commands as $command) { |
37 | 37 | $command = trim($command); |
38 | 38 | if ($command) { |
39 | - passthru(($this->sudo ? 'sudo ' : '') . $command); |
|
39 | + passthru(($this->sudo ? 'sudo ' : '').$command); |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | } |
@@ -15,6 +15,6 @@ |
||
15 | 15 | { |
16 | 16 | public function modify($command) |
17 | 17 | { |
18 | - return 'sudo ' . $command; |
|
18 | + return 'sudo '.$command; |
|
19 | 19 | } |
20 | 20 | } |
@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | if (!defined('HIDEV_VENDOR_DIR')) { |
13 | - foreach ([dirname(dirname(__DIR__)) . '/vendor', dirname(dirname(dirname(dirname(__DIR__))))] as $dir) { |
|
14 | - if (file_exists($dir . '/autoload.php')) { |
|
13 | + foreach ([dirname(dirname(__DIR__)).'/vendor', dirname(dirname(dirname(dirname(__DIR__))))] as $dir) { |
|
14 | + if (file_exists($dir.'/autoload.php')) { |
|
15 | 15 | define('HIDEV_VENDOR_DIR', $dir); |
16 | 16 | break; |
17 | 17 | } |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | exit(1); |
23 | 23 | } |
24 | 24 | |
25 | - require HIDEV_VENDOR_DIR . '/autoload.php'; |
|
26 | - require HIDEV_VENDOR_DIR . '/yiisoft/yii2/Yii.php'; |
|
25 | + require HIDEV_VENDOR_DIR.'/autoload.php'; |
|
26 | + require HIDEV_VENDOR_DIR.'/yiisoft/yii2/Yii.php'; |
|
27 | 27 | |
28 | 28 | Yii::setAlias('@hidev', dirname(__DIR__)); |
29 | 29 | } |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | Yii::setAlias('@root', $this->getRootDir()); |
79 | 79 | $config = $this->takeConfig()->rawItem('package'); |
80 | 80 | $alias = strtr($config['namespace'], '\\', '/'); |
81 | - if ($alias && !Yii::getAlias('@' . $alias, false)) { |
|
82 | - $srcdir = Yii::getAlias('@root/' . ($config['src'] ?: 'src')); |
|
81 | + if ($alias && !Yii::getAlias('@'.$alias, false)) { |
|
82 | + $srcdir = Yii::getAlias('@root/'.($config['src'] ?: 'src')); |
|
83 | 83 | Yii::setAlias($alias, $srcdir); |
84 | 84 | } |
85 | 85 | } |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | protected function findRootDir() |
190 | 190 | { |
191 | 191 | $configDir = '.hidev'; |
192 | - for ($i = 0;$i < 9;++$i) { |
|
192 | + for ($i = 0; $i < 9; ++$i) { |
|
193 | 193 | if (is_dir($configDir)) { |
194 | 194 | return getcwd(); |
195 | 195 | } |
@@ -200,6 +200,6 @@ discard block |
||
200 | 200 | |
201 | 201 | public function buildRootPath($subpath) |
202 | 202 | { |
203 | - return $this->getRootDir() . DIRECTORY_SEPARATOR . $subpath; |
|
203 | + return $this->getRootDir().DIRECTORY_SEPARATOR.$subpath; |
|
204 | 204 | } |
205 | 205 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | 'name' => 'HiDev', |
15 | 15 | 'basePath' => dirname(__DIR__), |
16 | 16 | 'vendorPath' => HIDEV_VENDOR_DIR, |
17 | - 'runtimePath' => substr(__DIR__, 0, 7) === 'phar://' ? dirname($_SERVER['SCRIPT_NAME']) : dirname(HIDEV_VENDOR_DIR) . '/runtime', |
|
17 | + 'runtimePath' => substr(__DIR__, 0, 7) === 'phar://' ? dirname($_SERVER['SCRIPT_NAME']) : dirname(HIDEV_VENDOR_DIR).'/runtime', |
|
18 | 18 | 'enableCoreCommands' => false, |
19 | 19 | 'controllerNamespace' => 'hidev\\controllers', |
20 | 20 | 'defaultRoute' => 'default', |