Browse Source

Fix psalm errors.

ADmad 6 years ago
parent
commit
dfb498f18b

+ 3 - 1
src/Command/PluginAssetsCopyCommand.php

@@ -23,6 +23,8 @@ use Cake\Console\ConsoleOptionParser;
 
 /**
  * Command for copying plugin assets to app's webroot.
+ *
+ * @psalm-suppress PropertyNotSetInConstructor
  */
 class PluginAssetsCopyCommand extends Command
 {
@@ -52,7 +54,7 @@ class PluginAssetsCopyCommand extends Command
         $this->args = $args;
 
         $name = $args->getArgument('name');
-        $overwrite = $args->getOption('overwrite');
+        $overwrite = (bool)$args->getOption('overwrite');
         $this->_process($this->_list($name), true, $overwrite);
 
         return static::CODE_SUCCESS;

+ 2 - 0
src/Command/PluginAssetsRemoveCommand.php

@@ -23,6 +23,8 @@ use Cake\Console\ConsoleOptionParser;
 
 /**
  * Command for removing plugin assets from app's webroot.
+ *
+ * @psalm-suppress PropertyNotSetInConstructor
  */
 class PluginAssetsRemoveCommand extends Command
 {

+ 3 - 1
src/Command/PluginAssetsSymlinkCommand.php

@@ -23,6 +23,8 @@ use Cake\Console\ConsoleOptionParser;
 
 /**
  * Command for symlinking / copying plugin assets to app's webroot.
+ *
+ * @psalm-suppress PropertyNotSetInConstructor
  */
 class PluginAssetsSymlinkCommand extends Command
 {
@@ -53,7 +55,7 @@ class PluginAssetsSymlinkCommand extends Command
         $this->args = $args;
 
         $name = $args->getArgument('name');
-        $overwrite = $args->getOption('overwrite');
+        $overwrite = (bool)$args->getOption('overwrite');
         $this->_process($this->_list($name), false, $overwrite);
 
         return static::CODE_SUCCESS;

+ 2 - 0
src/Command/PluginLoadCommand.php

@@ -23,6 +23,8 @@ use Cake\Console\ConsoleOptionParser;
 
 /**
  * Command for loading plugins.
+ *
+ * @psalm-suppress PropertyNotSetInConstructor
  */
 class PluginLoadCommand extends Command
 {