Completed
Push — master ( f9eb6d...e149f7 )
by Andrii
07:39
created
src/console/VersionController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         $version->load();
30 30
         $version->setRelease($release);
31 31
         $dir = dirname($version->getAbspath());
32
-        echo $version->renderFile() . PHP_EOL;
32
+        echo $version->renderFile().PHP_EOL;
33 33
         echo "(run from $dir)\n";
34 34
     }
35 35
 
@@ -44,6 +44,6 @@  discard block
 block discarded – undo
44 44
 
45 45
     public function getComponent()
46 46
     {
47
-        return $this->take(($this->own ? 'own.' : '') . 'version');
47
+        return $this->take(($this->own ? 'own.' : '').'version');
48 48
     }
49 49
 }
Please login to merge, or discard this patch.
src/console/InitController.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
             $this->package = $package;
50 50
         }
51 51
         if (!$this->package || !$this->vendor) {
52
-            throw new InvalidParamException('Wrong vendor/package given: ' . $name);
52
+            throw new InvalidParamException('Wrong vendor/package given: '.$name);
53 53
         }
54 54
     }
55 55
 
Please login to merge, or discard this patch.
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -69,6 +69,9 @@  discard block
 block discarded – undo
69 69
         );
70 70
     }
71 71
 
72
+    /**
73
+     * @param string|null $name
74
+     */
72 75
     public function prepareData($name)
73 76
     {
74 77
         $this->name = $name;
@@ -162,6 +165,9 @@  discard block
 block discarded – undo
162 165
         return $this->title ?: Helper::titleize($this->package);
163 166
     }
164 167
 
168
+    /**
169
+     * @return string
170
+     */
165 171
     public function getKeywords()
166 172
     {
167 173
         return $this->keywords ?: implode(', ', explode('-', $this->package));
Please login to merge, or discard this patch.
src/components/Directory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
             $type = isset($config['template']) || isset($config['copy']) ? 'File' : 'Directory';
27 27
             $defaults = [
28 28
                 'class' => "hidev\\components\\$type",
29
-                'path'  => $this->_path . '/' . $id,
29
+                'path'  => $this->_path.'/'.$id,
30 30
             ];
31 31
             $config = array_merge($defaults, $config ?: []);
32 32
             $object = Yii::createObject($config);
Please login to merge, or discard this patch.
src/handlers/BaseHandler.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -144,11 +144,11 @@
 block discarded – undo
144 144
     public function read($path, $asArray = false)
145 145
     {
146 146
         if (file_exists($path)) {
147
-            Yii::info('Read file: ' . $path, 'file');
147
+            Yii::info('Read file: '.$path, 'file');
148 148
 
149 149
             return $asArray ? file($path) : file_get_contents($path);
150 150
         } else {
151
-            Yii::warning('Couldn\'t read file: ' . $path, 'file');
151
+            Yii::warning('Couldn\'t read file: '.$path, 'file');
152 152
 
153 153
             return;
154 154
         }
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      * Renders file content using given data.
84 84
      * Converts to array with ArrayHelper::toArray.
85 85
      * @param mixed $data
86
-     * @return string file content
86
+     * @return boolean file content
87 87
      */
88 88
     public function renderPath($path, $data)
89 89
     {
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
      * Read file into a string or array.
133 133
      * @param string $path
134 134
      * @param bool $asArray
135
-     * @return string|array
135
+     * @return string
136 136
      */
137 137
     public function read($path, $asArray = false)
138 138
     {
Please login to merge, or discard this patch.
src/handlers/CopyHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
         } catch (\Exception $e) {
28 28
             throw new \RuntimeException("Failed to copy file \"{$data->getCopy()}\" to \"$path\": {$e->getMessage()}");
29 29
         }
30
-        Yii::warning('Copied file: ' . $path);
30
+        Yii::warning('Copied file: '.$path);
31 31
     }
32 32
 
33 33
     /**
Please login to merge, or discard this patch.
src/config/bootstrap.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,24 +7,24 @@
 block discarded – undo
7 7
  * @license   BSD-3-Clause
8 8
  * @copyright Copyright (c) 2015-2018, HiQDev (http://hiqdev.com/)
9 9
  */
10
-require_once __DIR__ . '/defines.php';
10
+require_once __DIR__.'/defines.php';
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
         }
18 18
     }
19 19
 }
20 20
 
21
-if (!defined('HIDEV_VENDOR_DIR') || !file_exists(HIDEV_VENDOR_DIR . '/autoload.php')) {
21
+if (!defined('HIDEV_VENDOR_DIR') || !file_exists(HIDEV_VENDOR_DIR.'/autoload.php')) {
22 22
     fwrite(STDERR, "Run composer to set up dependencies!\n");
23 23
     exit(1);
24 24
 }
25 25
 
26
-require_once HIDEV_VENDOR_DIR . '/autoload.php';
27
-require_once HIDEV_VENDOR_DIR . '/yiisoft/yii2/Yii.php';
26
+require_once HIDEV_VENDOR_DIR.'/autoload.php';
27
+require_once HIDEV_VENDOR_DIR.'/yiisoft/yii2/Yii.php';
28 28
 
29 29
 Yii::setAlias('@hidev', dirname(__DIR__));
30 30
 Yii::setAlias('@vendor', HIDEV_VENDOR_DIR);
Please login to merge, or discard this patch.
src/helpers/Helper.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -24,11 +24,17 @@
 block discarded – undo
24 24
         return method_exists(Yii::class, 'autoload');
25 25
     }
26 26
 
27
+    /**
28
+     * @return string
29
+     */
27 30
     public static function bad2sep($str, $separator = '-')
28 31
     {
29 32
         return preg_replace('/[^a-zA-Z0-9-]/', $separator, $str);
30 33
     }
31 34
 
35
+    /**
36
+     * @param string $id
37
+     */
32 38
     public static function id2camel($id, $separator = '-')
33 39
     {
34 40
         return Inflector::id2camel(self::bad2sep($id, $separator), $separator);
Please login to merge, or discard this patch.
src/config/basis.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
             },
Please login to merge, or discard this patch.
src/log/OldConsoleTarget.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
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()
Please login to merge, or discard this patch.