PluginDescription: fixed some very old refactoring errors

This commit is contained in:
Dylan K. Taylor 2020-10-15 13:55:29 +01:00
parent af4f30d1c8
commit 1fe4fdc67c

View File

@ -104,13 +104,13 @@ class PluginDescription{
$this->name = $plugin["name"];
if(preg_match('/^[A-Za-z0-9 _.-]+$/', $this->name) === 0){
throw new PluginException("Invalid PluginDescription name");
throw new PluginException("Invalid Plugin name");
}
$this->name = str_replace(" ", "_", $this->name);
$this->version = (string) $plugin["version"];
$this->main = $plugin["main"];
if(stripos($this->main, "pocketmine\\") === 0){
throw new PluginException("Invalid PluginDescription main, cannot start within the PocketMine namespace");
throw new PluginException("Invalid Plugin main, cannot start within the PocketMine namespace");
}
$this->api = array_map("\strval", (array) ($plugin["api"] ?? []));
@ -149,7 +149,7 @@ class PluginDescription{
if(isset($plugin["load"])){
$order = mb_strtoupper($plugin["load"]);
if(!defined(PluginLoadOrder::class . "::" . $order)){
throw new PluginException("Invalid PluginDescription load");
throw new PluginException("Invalid Plugin load");
}else{
$this->order = constant(PluginLoadOrder::class . "::" . $order);
}