1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Remove Psalm prefix to match psalm plugin skeleton composer.json

cc @weirdan - ran into this when trying to install a plugin
This commit is contained in:
Matthew Brown 2018-11-14 01:02:26 -05:00
parent 695f37e6c8
commit dede120fde
3 changed files with 11 additions and 7 deletions

View File

@ -57,6 +57,8 @@ class DisableCommand extends Command
$plugin_list = ($this->plugin_list_factory)($current_dir, $config_file_path);
$plugin_name = null;
try {
/** @psalm-suppress MixedAssignment */
$plugin_name = $i->getArgument('pluginName');
@ -64,7 +66,7 @@ class DisableCommand extends Command
$plugin_class = $plugin_list->resolvePluginClass($plugin_name);
} catch (InvalidArgumentException $e) {
$io->error('Unknown plugin class');
$io->error('Unknown plugin class ' . $plugin_name);
return 2;
}

View File

@ -57,6 +57,8 @@ class EnableCommand extends Command
$plugin_list = ($this->plugin_list_factory)($current_dir, $config_file_path);
$plugin_name = null;
try {
/** @psalm-suppress MixedAssignment */
$plugin_name = $i->getArgument('pluginName');
@ -64,7 +66,7 @@ class EnableCommand extends Command
$plugin_class = $plugin_list->resolvePluginClass($plugin_name);
} catch (InvalidArgumentException $e) {
$io->error('Unknown plugin class');
$io->error('Unknown plugin class ' . $plugin_name);
return 2;
}

View File

@ -16,7 +16,7 @@ class ComposerLock
/**
* @param mixed $package
* @psalm-assert-if-true array{type:'psalm-plugin',name:string,extra:array{psalm:array{pluginClass:string}}}
* @psalm-assert-if-true array{type:'psalm-plugin',name:string,extra:array{pluginClass:string}}
* $package
*/
public function isPlugin($package): bool
@ -26,8 +26,8 @@ class ComposerLock
&& is_string($package['name'])
&& isset($package['type'])
&& $package['type'] === 'psalm-plugin'
&& isset($package['extra']['psalm']['pluginClass'])
&& is_string($package['extra']['psalm']['pluginClass']);
&& isset($package['extra']['pluginClass'])
&& is_string($package['extra']['pluginClass']);
}
/**
@ -38,7 +38,7 @@ class ComposerLock
$pluginPackages = $this->getAllPluginPackages();
$ret = [];
foreach ($pluginPackages as $package) {
$ret[$package['name']] = $package['extra']['psalm']['pluginClass'];
$ret[$package['name']] = $package['extra']['pluginClass'];
}
return $ret;
}
@ -60,7 +60,7 @@ class ComposerLock
}
/**
* @return array<mixed,array{name:string,type:string,extra:array{psalm:array{pluginClass:string}}}>
* @return array<mixed,array{name:string,type:string,extra:array{pluginClass:string}}>
*/
private function getAllPluginPackages(): array
{