@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | |
17 | 17 | $__class = Helper::isYii20() ? 'class' : '__class'; |
18 | 18 | |
19 | -$runtimePath = (substr(__DIR__, 0, 7) === 'phar://' ? dirname($_SERVER['SCRIPT_NAME']) : dirname(HIDEV_VENDOR_DIR)) . '/.hidev/runtime'; |
|
19 | +$runtimePath = (substr(__DIR__, 0, 7) === 'phar://' ? dirname($_SERVER['SCRIPT_NAME']) : dirname(HIDEV_VENDOR_DIR)).'/.hidev/runtime'; |
|
20 | 20 | |
21 | 21 | return array_filter([ |
22 | 22 | 'id' => 'hidev', |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | ], |
106 | 106 | 'own.version' => [ |
107 | 107 | 'class' => \hidev\components\Version::class, |
108 | - 'file' => dirname(dirname(__DIR__)) . '/version', |
|
108 | + 'file' => dirname(dirname(__DIR__)).'/version', |
|
109 | 109 | ], |
110 | 110 | ]), |
111 | 111 | 'controllerMap' => [ |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | ], |
126 | 126 | 'container' => [ |
127 | 127 | 'singletons' => [ |
128 | - \hidev\components\AbstractVcs::class => function () { |
|
128 | + \hidev\components\AbstractVcs::class => function() { |
|
129 | 129 | $detectedVCS = 'git'; /// TODO actual detection to be added |
130 | 130 | return Yii::$app->get($detectedVCS); |
131 | 131 | }, |
@@ -39,7 +39,7 @@ |
||
39 | 39 | if ($style) { |
40 | 40 | $message = Console::ansiFormat($message, $style); |
41 | 41 | } |
42 | - Console::stdout($message . "\n"); |
|
42 | + Console::stdout($message."\n"); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | public function getLevel() |
@@ -19,10 +19,10 @@ |
||
19 | 19 | { |
20 | 20 | public static function exec($route, array $args, $wait = false) |
21 | 21 | { |
22 | - $path = dirname(__DIR__) . '/bin/hidev'; |
|
22 | + $path = dirname(__DIR__).'/bin/hidev'; |
|
23 | 23 | $command = "$path $route"; |
24 | 24 | foreach ($args as $arg) { |
25 | - $command .= ' ' . escapeshellarg($arg); |
|
25 | + $command .= ' '.escapeshellarg($arg); |
|
26 | 26 | } |
27 | 27 | $amp = $wait ? '' : '&'; |
28 | 28 |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | { |
47 | 47 | if ($this->exportContext[$level] ?? false) { |
48 | 48 | $export = VarDumper::export($context); |
49 | - Console::stdout($export . "\n"); |
|
49 | + Console::stdout($export."\n"); |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | } else { |
63 | 63 | return; |
64 | 64 | } |
65 | - Console::stdout($message . "\n"); |
|
65 | + Console::stdout($message."\n"); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | protected function getContextMessage() |
@@ -48,16 +48,16 @@ |
||
48 | 48 | { |
49 | 49 | $path = parent::detectCommand($path); |
50 | 50 | |
51 | - return is_executable($path) ? $path : '/usr/bin/env python ' . $path; |
|
51 | + return is_executable($path) ? $path : '/usr/bin/env python '.$path; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | public function install() |
55 | 55 | { |
56 | 56 | if ($this->installer) { |
57 | - passthru('/usr/bin/env wget ' . escapeshellarg($this->installer) . ' -O- | /usr/bin/env python', $exitcode); |
|
57 | + passthru('/usr/bin/env wget '.escapeshellarg($this->installer).' -O- | /usr/bin/env python', $exitcode); |
|
58 | 58 | } elseif ($this->download) { |
59 | - $dest = Yii::getAlias('@root/' . $this->name, false); |
|
60 | - passthru('/usr/bin/env wget ' . escapeshellarg($this->download) . ' -O ' . $dest, $exitcode); |
|
59 | + $dest = Yii::getAlias('@root/'.$this->name, false); |
|
60 | + passthru('/usr/bin/env wget '.escapeshellarg($this->download).' -O '.$dest, $exitcode); |
|
61 | 61 | } else { |
62 | 62 | $args = ['pip', 'install']; |
63 | 63 | if (!$_SERVER['VIRTUAL_ENV']) { |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | public function getFull_name() |
37 | 37 | { |
38 | - return $this->getVendor() . '/' . $this->getName(); |
|
38 | + return $this->getVendor().'/'.$this->getName(); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | public function setFullName($value) |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | public function createRepo(string $repo = null) |
112 | 112 | { |
113 | 113 | $end = $this->getVendorType() === 'org' |
114 | - ?'/orgs/' . $this->getVendor() . '/repos' |
|
114 | + ? '/orgs/'.$this->getVendor().'/repos' |
|
115 | 115 | : '/user/repos' |
116 | 116 | ; |
117 | 117 | $res = $this->request('POST', $end, [ |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public function cloneRepo($repo) |
136 | 136 | { |
137 | - return $this->passthru('git', ['clone', '[email protected]:' . $repo]); |
|
137 | + return $this->passthru('git', ['clone', '[email protected]:'.$repo]); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public static function exists($repo) |
156 | 156 | { |
157 | - return !static::exec('git', ['ls-remote', '[email protected]:' . $repo], true); |
|
157 | + return !static::exec('git', ['ls-remote', '[email protected]:'.$repo], true); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | return $wait; |
171 | 171 | } |
172 | 172 | |
173 | - return $this->request('POST', '/repos/' . $this->getFull_name() . '/releases', [ |
|
173 | + return $this->request('POST', '/repos/'.$this->getFull_name().'/releases', [ |
|
174 | 174 | 'tag_name' => $release, |
175 | 175 | 'name' => $release, |
176 | 176 | 'body' => $notes, |
@@ -191,9 +191,9 @@ discard block |
||
191 | 191 | |
192 | 192 | public function request($method, $path, $data) |
193 | 193 | { |
194 | - $url = 'https://api.github.com' . $path; |
|
194 | + $url = 'https://api.github.com'.$path; |
|
195 | 195 | |
196 | - return $this->passthru('curl', ['-X', $method, '-H', 'Authorization: token ' . $this->getToken(), '--data', Json::encode($data), $url]); |
|
196 | + return $this->passthru('curl', ['-X', $method, '-H', 'Authorization: token '.$this->getToken(), '--data', Json::encode($data), $url]); |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | public function findToken() |
@@ -22,7 +22,7 @@ |
||
22 | 22 | { |
23 | 23 | FileHelper::mkdir($this->_path); |
24 | 24 | |
25 | - foreach ($this->getItems() as $id => $config) { |
|
25 | + foreach ($this->getItems() as $id => $config) { |
|
26 | 26 | $type = 'Directory'; |
27 | 27 | if (isset($config['template']) || isset($config['copy'])) { |
28 | 28 | $type = 'File'; |
@@ -31,7 +31,7 @@ |
||
31 | 31 | } |
32 | 32 | $defaults = [ |
33 | 33 | 'class' => "hidev\\components\\$type", |
34 | - 'path' => $this->_path . '/' . $id, |
|
34 | + 'path' => $this->_path.'/'.$id, |
|
35 | 35 | ]; |
36 | 36 | $config = array_merge($defaults, $config ?: []); |
37 | 37 | $object = Yii::createObject($config); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | public function autoload() |
13 | 13 | { |
14 | - $path = $this->getPath('vendor/autoload.php'); |
|
14 | + $path = $this->getPath('vendor/autoload.php'); |
|
15 | 15 | if (!file_exists($path)) { |
16 | 16 | $this->run('update'); |
17 | 17 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | public function getCmd(): string |
32 | 32 | { |
33 | - return 'composer' . ($this->dir ? " -d $dir" : ''); |
|
33 | + return 'composer'.($this->dir ? " -d $dir" : ''); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | public function getPath(string $file): string |
@@ -39,6 +39,6 @@ discard block |
||
39 | 39 | return $file; |
40 | 40 | } |
41 | 41 | |
42 | - return $this->dir ? $this->dir . DIRECTORY_SEPARATOR . $file : $file; |
|
42 | + return $this->dir ? $this->dir.DIRECTORY_SEPARATOR.$file : $file; |
|
43 | 43 | } |
44 | 44 | } |