PluginDescription: drop unenforceable type constraint on array keys

the data that comes through here isn't validated, and there's also no guarantee that all the keys will be strings in spite of our best efforts even if it was validated, because PHP is fucking stupid and casts int-like string keys to int keys.
This commit is contained in:
Dylan K. Taylor 2020-03-05 19:53:01 +00:00
parent 93e5c80962
commit 15d81154e6

View File

@ -89,7 +89,6 @@ class PluginDescription{
/**
* @param string|mixed[] $yamlString
* @phpstan-param string|array<string, mixed> $yamlString
*/
public function __construct($yamlString){
$this->loadMap(!is_array($yamlString) ? yaml_parse($yamlString) : $yamlString);
@ -97,7 +96,6 @@ class PluginDescription{
/**
* @param mixed[] $plugin
* @phpstan-param array<string, mixed> $plugin
* @throws PluginException
*/
private function loadMap(array $plugin) : void{