@@ -49,16 +49,16 @@ |
||
49 | 49 | { |
50 | 50 | $path = parent::detectCommand($path); |
51 | 51 | |
52 | - return is_executable($path) ? $path : '/usr/bin/env python ' . $path; |
|
52 | + return is_executable($path) ? $path : '/usr/bin/env python '.$path; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | public function install() |
56 | 56 | { |
57 | 57 | if ($this->installer) { |
58 | - passthru('/usr/bin/env wget ' . escapeshellarg($this->installer) . ' -O- | /usr/bin/env python', $exitcode); |
|
58 | + passthru('/usr/bin/env wget '.escapeshellarg($this->installer).' -O- | /usr/bin/env python', $exitcode); |
|
59 | 59 | } elseif ($this->download) { |
60 | - $dest = Yii::getAlias('@root/' . $this->name, false); |
|
61 | - passthru('/usr/bin/env wget ' . escapeshellarg($this->download) . ' -O ' . $dest, $exitcode); |
|
60 | + $dest = Yii::getAlias('@root/'.$this->name, false); |
|
61 | + passthru('/usr/bin/env wget '.escapeshellarg($this->download).' -O '.$dest, $exitcode); |
|
62 | 62 | } else { |
63 | 63 | $args = ['install']; |
64 | 64 | if (!$_SERVER['VIRTUAL_ENV']) { |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | unlink($tmp); |
45 | 45 | } |
46 | 46 | } |
47 | - Yii::warning('Written file: ' . $path, 'file'); |
|
47 | + Yii::warning('Written file: '.$path, 'file'); |
|
48 | 48 | |
49 | 49 | return true; |
50 | 50 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $path = rtrim(trim($path), '/'); |
62 | 62 | if (!file_exists($path)) { |
63 | 63 | mkdir($path, 0777, true); |
64 | - Yii::warning('Created dir: ' . $path . '/', 'file'); |
|
64 | + Yii::warning('Created dir: '.$path.'/', 'file'); |
|
65 | 65 | |
66 | 66 | return true; |
67 | 67 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | |
26 | 26 | public function actionMake($version = null) |
27 | 27 | { |
28 | - $path = dirname(dirname(__DIR__)) . '/bin/hidev'; |
|
28 | + $path = dirname(dirname(__DIR__)).'/bin/hidev'; |
|
29 | 29 | echo "HiDev $this->version $this->date $this->time $this->hash\n"; |
30 | 30 | echo "run from $path\n"; |
31 | 31 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | $this->interpolate($item); |
15 | 15 | } |
16 | 16 | } elseif (is_string($data)) { |
17 | - $data = preg_replace_callback('/\\$(\\w+)\\[\'(.+?)\'\\]/', function ($matches) { |
|
17 | + $data = preg_replace_callback('/\\$(\\w+)\\[\'(.+?)\'\\]/', function($matches) { |
|
18 | 18 | return $this->get($matches[1], $matches[2]); |
19 | 19 | }, $data); |
20 | 20 | } |
@@ -91,6 +91,10 @@ discard block |
||
91 | 91 | $this->setExtraConfig(static::readVendorConfig($vendor, 'hidev')); |
92 | 92 | } |
93 | 93 | |
94 | + /** |
|
95 | + * @param string $vendor |
|
96 | + * @param string $name |
|
97 | + */ |
|
94 | 98 | public function readVendorConfig($vendor, $name) |
95 | 99 | { |
96 | 100 | return static::readConfig(ConfigPlugin::path($vendor, $name)); |
@@ -98,7 +102,6 @@ discard block |
||
98 | 102 | |
99 | 103 | /** |
100 | 104 | * Sets extra environment variables. |
101 | - * @param array $config |
|
102 | 105 | */ |
103 | 106 | public function setExtraEnv($vars) |
104 | 107 | { |
@@ -199,8 +202,8 @@ discard block |
||
199 | 202 | |
200 | 203 | /** |
201 | 204 | * Run request. |
202 | - * @param string|array $query |
|
203 | - * @return Response |
|
205 | + * @param string $query |
|
206 | + * @return \yii\console\Response |
|
204 | 207 | */ |
205 | 208 | public function runRequest($query) |
206 | 209 | { |
@@ -82,7 +82,7 @@ |
||
82 | 82 | |
83 | 83 | foreach (['params', 'aliases', 'modules', 'components', 'container'] as $key) { |
84 | 84 | if (isset($config[$key])) { |
85 | - $this->{'setExtra' . ucfirst($key)}($config[$key]); |
|
85 | + $this->{'setExtra'.ucfirst($key)}($config[$key]); |
|
86 | 86 | } |
87 | 87 | } |
88 | 88 |
@@ -37,7 +37,7 @@ |
||
37 | 37 | if ($style) { |
38 | 38 | $message = Console::ansiFormat($message, $style); |
39 | 39 | } |
40 | - Console::stdout($message . "\n"); |
|
40 | + Console::stdout($message."\n"); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | protected function getContextMessage() |
@@ -8,24 +8,24 @@ |
||
8 | 8 | * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) |
9 | 9 | */ |
10 | 10 | |
11 | -require_once __DIR__ . '/defines.php'; |
|
11 | +require_once __DIR__.'/defines.php'; |
|
12 | 12 | |
13 | 13 | if (!defined('HIDEV_VENDOR_DIR')) { |
14 | - foreach ([dirname(dirname(__DIR__)) . '/vendor', dirname(dirname(dirname(dirname(__DIR__))))] as $dir) { |
|
15 | - if (file_exists($dir . '/autoload.php')) { |
|
14 | + foreach ([dirname(dirname(__DIR__)).'/vendor', dirname(dirname(dirname(dirname(__DIR__))))] as $dir) { |
|
15 | + if (file_exists($dir.'/autoload.php')) { |
|
16 | 16 | define('HIDEV_VENDOR_DIR', $dir); |
17 | 17 | break; |
18 | 18 | } |
19 | 19 | } |
20 | 20 | } |
21 | 21 | |
22 | -if (!defined('HIDEV_VENDOR_DIR') || !file_exists(HIDEV_VENDOR_DIR . '/autoload.php')) { |
|
22 | +if (!defined('HIDEV_VENDOR_DIR') || !file_exists(HIDEV_VENDOR_DIR.'/autoload.php')) { |
|
23 | 23 | fwrite(STDERR, "Run composer to set up dependencies!\n"); |
24 | 24 | exit(1); |
25 | 25 | } |
26 | 26 | |
27 | -require_once HIDEV_VENDOR_DIR . '/autoload.php'; |
|
28 | -require_once HIDEV_VENDOR_DIR . '/yiisoft/yii2/Yii.php'; |
|
27 | +require_once HIDEV_VENDOR_DIR.'/autoload.php'; |
|
28 | +require_once HIDEV_VENDOR_DIR.'/yiisoft/yii2/Yii.php'; |
|
29 | 29 | |
30 | 30 | Yii::setAlias('@hidev', dirname(__DIR__)); |
31 | 31 | Yii::setAlias('@vendor', HIDEV_VENDOR_DIR); |
@@ -87,8 +87,8 @@ discard block |
||
87 | 87 | Yii::setAlias('@root', $this->getRootDir()); |
88 | 88 | $config = $this->takeConfig()->rawItem('package'); |
89 | 89 | $alias = isset($config['namespace']) ? strtr($config['namespace'], '\\', '/') : ''; |
90 | - if ($alias && !Yii::getAlias('@' . $alias, false)) { |
|
91 | - $srcdir = Yii::getAlias('@root/' . ($config['src'] ?: 'src')); |
|
90 | + if ($alias && !Yii::getAlias('@'.$alias, false)) { |
|
91 | + $srcdir = Yii::getAlias('@root/'.($config['src'] ?: 'src')); |
|
92 | 92 | Yii::setAlias($alias, $srcdir); |
93 | 93 | } |
94 | 94 | $aliases = $this->takeConfig()->rawItem('aliases'); |
@@ -121,13 +121,13 @@ discard block |
||
121 | 121 | if ($file->save($data) || !is_dir('.hidev/vendor')) { |
122 | 122 | $this->runAction('update'); |
123 | 123 | } |
124 | - $vendors[] = $this->getRootDir() . '/.hidev/vendor'; |
|
124 | + $vendors[] = $this->getRootDir().'/.hidev/vendor'; |
|
125 | 125 | } elseif ($this->needsComposerInstall()) { |
126 | 126 | if ($this->passthru('composer', ['install', '--ansi'])) { |
127 | 127 | throw new InvalidParamException('Failed initialize project with composer install'); |
128 | 128 | } |
129 | 129 | } |
130 | - $localVendor = $this->getRootDir() . '/vendor'; |
|
130 | + $localVendor = $this->getRootDir().'/vendor'; |
|
131 | 131 | if (file_exists(ConfigPlugin::path($localVendor, 'hidev'))) { |
132 | 132 | $vendors[] = $localVendor; |
133 | 133 | } |
@@ -222,6 +222,6 @@ discard block |
||
222 | 222 | |
223 | 223 | public function buildRootPath($subpath) |
224 | 224 | { |
225 | - return $this->getRootDir() . DIRECTORY_SEPARATOR . $subpath; |
|
225 | + return $this->getRootDir().DIRECTORY_SEPARATOR.$subpath; |
|
226 | 226 | } |
227 | 227 | } |