diff --git a/src/plugin/FolderPluginLoader.php b/src/plugin/FolderPluginLoader.php index 9250a4e15..73f6b8841 100644 --- a/src/plugin/FolderPluginLoader.php +++ b/src/plugin/FolderPluginLoader.php @@ -41,19 +41,19 @@ class FolderPluginLoader implements PluginLoader{ /** * Loads the plugin contained in $file */ - public function loadPlugin(string $file) : void{ - $description = $this->getPluginDescription($file); + public function loadPlugin(string $path) : void{ + $description = $this->getPluginDescription($path); if($description !== null){ - $this->loader->addPath($description->getSrcNamespacePrefix(), "$file/src"); + $this->loader->addPath($description->getSrcNamespacePrefix(), "$path/src"); } } /** * Gets the PluginDescription from the file */ - public function getPluginDescription(string $file) : ?PluginDescription{ - $pluginYmlPath = Path::join($file, "plugin.yml"); - if(is_dir($file) && file_exists($pluginYmlPath)){ + public function getPluginDescription(string $path) : ?PluginDescription{ + $pluginYmlPath = Path::join($path, "plugin.yml"); + if(is_dir($path) && file_exists($pluginYmlPath)){ try{ $yaml = Filesystem::fileGetContents($pluginYmlPath); }catch(\RuntimeException){ diff --git a/src/plugin/PharPluginLoader.php b/src/plugin/PharPluginLoader.php index a8dc04804..1ef8f2b84 100644 --- a/src/plugin/PharPluginLoader.php +++ b/src/plugin/PharPluginLoader.php @@ -42,18 +42,18 @@ class PharPluginLoader implements PluginLoader{ /** * Loads the plugin contained in $file */ - public function loadPlugin(string $file) : void{ - $description = $this->getPluginDescription($file); + public function loadPlugin(string $path) : void{ + $description = $this->getPluginDescription($path); if($description !== null){ - $this->loader->addPath($description->getSrcNamespacePrefix(), "$file/src"); + $this->loader->addPath($description->getSrcNamespacePrefix(), "$path/src"); } } /** * Gets the PluginDescription from the file */ - public function getPluginDescription(string $file) : ?PluginDescription{ - $phar = new \Phar($file); + public function getPluginDescription(string $path) : ?PluginDescription{ + $phar = new \Phar($path); if(isset($phar["plugin.yml"])){ return new PluginDescription($phar["plugin.yml"]->getContent()); } diff --git a/src/plugin/PluginLoader.php b/src/plugin/PluginLoader.php index 58c168373..d87daf9fc 100644 --- a/src/plugin/PluginLoader.php +++ b/src/plugin/PluginLoader.php @@ -36,13 +36,13 @@ interface PluginLoader{ /** * Loads the plugin contained in $file */ - public function loadPlugin(string $file) : void; + public function loadPlugin(string $path) : void; /** * Gets the PluginDescription from the file * @throws PluginDescriptionParseException */ - public function getPluginDescription(string $file) : ?PluginDescription; + public function getPluginDescription(string $path) : ?PluginDescription; /** * Returns the protocol prefix used to access files in this plugin, e.g. file://, phar:// diff --git a/src/plugin/ScriptPluginLoader.php b/src/plugin/ScriptPluginLoader.php index 36d522c93..8e45eaab8 100644 --- a/src/plugin/ScriptPluginLoader.php +++ b/src/plugin/ScriptPluginLoader.php @@ -46,15 +46,15 @@ class ScriptPluginLoader implements PluginLoader{ /** * Loads the plugin contained in $file */ - public function loadPlugin(string $file) : void{ - include_once $file; + public function loadPlugin(string $path) : void{ + include_once $path; } /** * Gets the PluginDescription from the file */ - public function getPluginDescription(string $file) : ?PluginDescription{ - $content = @file($file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + public function getPluginDescription(string $path) : ?PluginDescription{ + $content = @file($path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); if($content === false){ return null; }