@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * |
92 | 92 | * @param mixed $data |
93 | 93 | * |
94 | - * @return string file content |
|
94 | + * @return boolean file content |
|
95 | 95 | */ |
96 | 96 | public function renderPath($path, $data) |
97 | 97 | { |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | * Read file into a string or array. |
157 | 157 | * @param string $path |
158 | 158 | * @param bool $asArray |
159 | - * @return string|array |
|
159 | + * @return string |
|
160 | 160 | */ |
161 | 161 | public function read($path, $asArray = false) |
162 | 162 | { |
@@ -146,11 +146,11 @@ |
||
146 | 146 | public function read($path, $asArray = false) |
147 | 147 | { |
148 | 148 | if (file_exists($path)) { |
149 | - Yii::info('Read file: ' . $path, 'file'); |
|
149 | + Yii::info('Read file: '.$path, 'file'); |
|
150 | 150 | |
151 | 151 | return $asArray ? file($path) : file_get_contents($path); |
152 | 152 | } else { |
153 | - Yii::error('Couldn\'t read file: ' . $path, 'file'); |
|
153 | + Yii::error('Couldn\'t read file: '.$path, 'file'); |
|
154 | 154 | |
155 | 155 | return; |
156 | 156 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | */ |
24 | 24 | public function renderType($data) |
25 | 25 | { |
26 | - return Json::encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) . "\n"; |
|
26 | + return Json::encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)."\n"; |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $res = ''; |
49 | 49 | foreach ($comments as $comment => $items) { |
50 | 50 | ksort($items); |
51 | - $res .= static::renderComment($comment) . implode("\n", $items) . "\n"; |
|
51 | + $res .= static::renderComment($comment).implode("\n", $items)."\n"; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | return ltrim($res); |
@@ -56,6 +56,6 @@ discard block |
||
56 | 56 | |
57 | 57 | public static function renderComment($comment) |
58 | 58 | { |
59 | - return "\n#" . ($comment[0] === '#' ? '' : ' ') . "$comment\n"; |
|
59 | + return "\n#".($comment[0] === '#' ? '' : ' ')."$comment\n"; |
|
60 | 60 | } |
61 | 61 | } |
@@ -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 | /** |
@@ -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; |
@@ -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 | } |
@@ -46,16 +46,16 @@ discard block |
||
46 | 46 | { |
47 | 47 | $path = parent::detectCommand($path); |
48 | 48 | |
49 | - return is_executable($path) ? $path : '/usr/bin/env php ' . $path; |
|
49 | + return is_executable($path) ? $path : '/usr/bin/env php '.$path; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | public function install() |
53 | 53 | { |
54 | 54 | if ($this->installer) { |
55 | - passthru('/usr/bin/env wget ' . escapeshellarg($this->installer) . ' -O- | /usr/bin/env php', $exitcode); |
|
55 | + passthru('/usr/bin/env wget '.escapeshellarg($this->installer).' -O- | /usr/bin/env php', $exitcode); |
|
56 | 56 | } elseif ($this->download) { |
57 | - $dest = Yii::getAlias('@root/' . $this->name . '.phar', false); |
|
58 | - passthru('/usr/bin/env wget ' . escapeshellarg($this->download) . ' -O ' . $dest, $exitcode); |
|
57 | + $dest = Yii::getAlias('@root/'.$this->name.'.phar', false); |
|
58 | + passthru('/usr/bin/env wget '.escapeshellarg($this->download).' -O '.$dest, $exitcode); |
|
59 | 59 | } else { |
60 | 60 | return parent::install(); |
61 | 61 | } |
@@ -65,6 +65,6 @@ discard block |
||
65 | 65 | |
66 | 66 | public function getVcsignore() |
67 | 67 | { |
68 | - return $this->name . '.phar'; |
|
68 | + return $this->name.'.phar'; |
|
69 | 69 | } |
70 | 70 | } |
@@ -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']) { |
@@ -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); |