Completed
Push — master ( 0b604a...0586b5 )
by Andrii
04:48
created
src/handlers/CommitsHandler.php 2 patches
Doc Comments   +16 added lines patch added patch discarded remove patch
@@ -59,6 +59,9 @@  discard block
 block discarded – undo
59 59
         $this->_hash = $hash;
60 60
     }
61 61
 
62
+    /**
63
+     * @param string $label
64
+     */
62 65
     public function addTag($tag, $label = null)
63 66
     {
64 67
         $this->tag = $tag;
@@ -66,6 +69,9 @@  discard block
 block discarded – undo
66 69
         $ref       = $label ?: $ref ?: $tag;
67 70
     }
68 71
 
72
+    /**
73
+     * @param string $note
74
+     */
69 75
     public function addNote($note, $label = null)
70 76
     {
71 77
         $this->note = $note;
@@ -73,6 +79,10 @@  discard block
 block discarded – undo
73 79
         $ref        = $label ?: $ref ?: $note;
74 80
     }
75 81
 
82
+    /**
83
+     * @param string $hash
84
+     * @param string $label
85
+     */
76 86
     public function addHash($hash, $label)
77 87
     {
78 88
         $this->_hash                    = $hash;
@@ -183,6 +193,9 @@  discard block
 block discarded – undo
183 193
         return $res;
184 194
     }
185 195
 
196
+    /**
197
+     * @param string $key
198
+     */
186 199
     public static function arrayPop(&$array, $key)
187 200
     {
188 201
         $res = $array[$key];
@@ -239,6 +252,9 @@  discard block
 block discarded – undo
239 252
         return $date ? date(' Y-m-d', strtotime($date)) : '';
240 253
     }
241 254
 
255
+    /**
256
+     * @param string $string
257
+     */
242 258
     public static function renderHeader($string)
243 259
     {
244 260
         $header = Yii::$app->config->package->fullName . ' ' . $string;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
     {
213 213
         $res = implode("\n", array_filter($lines));
214 214
 
215
-        return $res ? $res . "\n" : '';
215
+        return $res ? $res."\n" : '';
216 216
     }
217 217
 
218 218
     public static function renderCommit($commit)
@@ -262,9 +262,9 @@  discard block
 block discarded – undo
262 262
 
263 263
     public static function renderHeader($string)
264 264
     {
265
-        $header = Yii::$app->config->package->fullName . ' ' . $string;
265
+        $header = Yii::$app->config->package->fullName.' '.$string;
266 266
 
267
-        return $header . "\n" . str_repeat('-', mb_strlen($header, Yii::$app->charset)) . "\n";
267
+        return $header."\n".str_repeat('-', mb_strlen($header, Yii::$app->charset))."\n";
268 268
     }
269 269
 
270 270
     public static function getVcs()
Please login to merge, or discard this patch.
src/components/Config.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -72,6 +72,9 @@
 block discarded – undo
72 72
         return false;
73 73
     }
74 74
 
75
+    /**
76
+     * @param string $id
77
+     */
75 78
     public function getGoal($id)
76 79
     {
77 80
         return Yii::$app->createControllerById($id);
Please login to merge, or discard this patch.
src/base/File.php 2 patches
Doc Comments   +12 added lines patch added patch discarded remove patch
@@ -122,6 +122,9 @@  discard block
 block discarded – undo
122 122
         return $type2extension[$type];
123 123
     }
124 124
 
125
+    /**
126
+     * @param string $extension
127
+     */
125 128
     public function getTypeByExtension($extension)
126 129
     {
127 130
         return static::$_extension2type[$extension];
@@ -132,6 +135,9 @@  discard block
 block discarded – undo
132 135
         return ($this->goal ? $this->goal->fileType : null) ?: static::getTypeByExtension($this->_extension) ?: 'template';
133 136
     }
134 137
 
138
+    /**
139
+     * @param string $path
140
+     */
135 141
     public function setPath($path)
136 142
     {
137 143
         $path             = Yii::getAlias($path);
@@ -208,6 +214,9 @@  discard block
 block discarded – undo
208 214
         return $this->handler->renderPath($this->path, $this->data);
209 215
     }
210 216
 
217
+    /**
218
+     * @param string $content
219
+     */
211 220
     public function write($content)
212 221
     {
213 222
         return $this->handler->write($this->path, $content);
@@ -218,6 +227,9 @@  discard block
 block discarded – undo
218 227
         return $this->data = $this->handler->parsePath($this->path, $this->minimalPath);
219 228
     }
220 229
 
230
+    /**
231
+     * @return string
232
+     */
221 233
     public function read()
222 234
     {
223 235
         return $this->handler->read($this->path);
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/controllers/GithubController.php 2 patches
Doc Comments   +5 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     /**
114 114
      * Action to check if repo exists.
115 115
      * @param string $repo full name vendor/package defaults to this repo name
116
-     * @return int exit code
116
+     * @return boolean exit code
117 117
      */
118 118
     public function actionExists($repo = null)
119 119
     {
@@ -160,6 +160,10 @@  discard block
 block discarded – undo
160 160
         return 0;
161 161
     }
162 162
 
163
+    /**
164
+     * @param string $method
165
+     * @param string $path
166
+     */
163 167
     public function request($method, $path, $data)
164 168
     {
165 169
         $url = 'https://api.github.com' . $path;
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
     public function getFull_name()
36 36
     {
37
-        return $this->getVendor() . '/' . $this->getName();
37
+        return $this->getVendor().'/'.$this->getName();
38 38
     }
39 39
 
40 40
     public function setFullName($value)
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      */
96 96
     public function actionCreate()
97 97
     {
98
-        $res = $this->request('POST', '/orgs/' . $this->getVendor() . '/repos', [
98
+        $res = $this->request('POST', '/orgs/'.$this->getVendor().'/repos', [
99 99
             'name'        => $this->getName(),
100 100
             'description' => $this->getDescription(),
101 101
         ]);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public function actionClone($repo)
116 116
     {
117
-        return $this->passthru('git', ['clone', '[email protected]:' . $repo]);
117
+        return $this->passthru('git', ['clone', '[email protected]:'.$repo]);
118 118
     }
119 119
 
120 120
     /**
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
      */
135 135
     public static function exists($repo)
136 136
     {
137
-        return !static::exec('git', ['ls-remote', '[email protected]:' . $repo], true);
137
+        return !static::exec('git', ['ls-remote', '[email protected]:'.$repo], true);
138 138
     }
139 139
 
140 140
     public function actionRelease($version = null)
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
             return $wait;
149 149
         }
150 150
 
151
-        return $this->request('POST', '/repos/' . $this->getFull_name() . '/releases', [
151
+        return $this->request('POST', '/repos/'.$this->getFull_name().'/releases', [
152 152
             'tag_name'  => $version,
153 153
             'name'      => $version,
154 154
             'body'      => $notes,
@@ -169,9 +169,9 @@  discard block
 block discarded – undo
169 169
 
170 170
     public function request($method, $path, $data)
171 171
     {
172
-        $url = 'https://api.github.com' . $path;
172
+        $url = 'https://api.github.com'.$path;
173 173
 
174
-        return $this->passthru('curl', ['-X', $method, '-H', 'Authorization: token ' . $this->getToken(), '--data', Json::encode($data), $url]);
174
+        return $this->passthru('curl', ['-X', $method, '-H', 'Authorization: token '.$this->getToken(), '--data', Json::encode($data), $url]);
175 175
     }
176 176
 
177 177
     public function findToken()
Please login to merge, or discard this patch.
src/handlers/BaseHandler.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         if (!is_file($path) || file_get_contents($path) !== $content) {
127 127
             $this->mkdir(dirname($path));
128 128
             file_put_contents($path, $content);
129
-            Yii::warning('Written file: ' . $path, 'file');
129
+            Yii::warning('Written file: '.$path, 'file');
130 130
 
131 131
             return true;
132 132
         }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         $path = trim(trim($path), '/');
145 145
         if (!file_exists($path)) {
146 146
             mkdir($path, 0777, true);
147
-            Yii::warning('Created dir:  ' . $path . '/', 'file');
147
+            Yii::warning('Created dir:  '.$path.'/', 'file');
148 148
 
149 149
             return true;
150 150
         }
@@ -161,11 +161,11 @@  discard block
 block discarded – undo
161 161
     public function read($path, $asArray = false)
162 162
     {
163 163
         if (file_exists($path)) {
164
-            Yii::info('Read file: ' . $path, 'file');
164
+            Yii::info('Read file: '.$path, 'file');
165 165
 
166 166
             return $asArray ? file($path) : file_get_contents($path);
167 167
         } else {
168
-            Yii::error('Couldn\'t read file: ' . $path, 'file');
168
+            Yii::error('Couldn\'t read file: '.$path, 'file');
169 169
 
170 170
             return;
171 171
         }
Please login to merge, or discard this patch.
src/controllers/AbstractController.php 1 patch
Doc Comments   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     }
49 49
 
50 50
     /**
51
-     * @return int|Response exit code
51
+     * @return null|integer exit code
52 52
      */
53 53
     public function actionMake()
54 54
     {
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     /**
143 143
      * Is response NOT Ok.
144 144
      * @param Response|int $res
145
-     * @return bool
145
+     * @return integer
146 146
      */
147 147
     public static function isNotOk($res)
148 148
     {
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
     /**
153 153
      * Is response Ok.
154
-     * @param Response|int $res
154
+     * @param integer $res
155 155
      * @return bool
156 156
      */
157 157
     public static function isOk($res)
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
      * Runs list of actions.
164 164
      * TODO: think to redo with runRequests.
165 165
      * @param null|string|array $actions
166
-     * @return int|Response exit code
166
+     * @return null|integer exit code
167 167
      */
168 168
     public function runActions($actions)
169 169
     {
@@ -240,6 +240,9 @@  discard block
 block discarded – undo
240 240
         return readline($prompt);
241 241
     }
242 242
 
243
+    /**
244
+     * @param string $prompt
245
+     */
243 246
     public function readpassword($prompt)
244 247
     {
245 248
         echo $prompt;
@@ -250,6 +253,9 @@  discard block
 block discarded – undo
250 253
         return $password;
251 254
     }
252 255
 
256
+    /**
257
+     * @param string $id
258
+     */
253 259
     public static function takeGoal($id)
254 260
     {
255 261
         return Yii::$app->get('config')->getGoal($id);
Please login to merge, or discard this patch.
src/handlers/JsonHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
src/handlers/GitignoreHandler.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/controllers/VcsignoreController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
     {
38 38
         $items = [];
39 39
         foreach ($this->takeGoal('binaries')->keys() as $name) {
40
-            $items[$name . '.phar'] = 'PHARs';
40
+            $items[$name.'.phar'] = 'PHARs';
41 41
         }
42 42
         unset($items['git.phar']);
43 43
         $this->takeVcs()->setIgnore($items);
Please login to merge, or discard this patch.