Fix typos in class docs/exception messages

This commit is contained in:
Daniel Rudolf 2016-03-02 22:10:49 +01:00
parent 1709b920d1
commit 2a3e2fa576

View File

@ -405,7 +405,13 @@ class Pico
$this->plugins[$className] = $plugin; $this->plugins[$className] = $plugin;
} else { } else {
// TODO: breaks backward compatibility // TODO: breaks backward compatibility
//throw new RuntimeException("Unable to load plugin '" . $className . "'"); /*
$pluginFileName = substr($pluginFile, strlen($this->getPluginsDir()));
throw new RuntimeException(
"Unable to load plugin '" . $className . "' "
. "from '" . $pluginFileName . "'"
);
*/
} }
} }
} }
@ -431,15 +437,15 @@ class Pico
if (class_exists($className)) { if (class_exists($className)) {
$plugin = new $className($this); $plugin = new $className($this);
} else { } else {
throw new RuntimeException("Unable to load plugin '" . $className . "'"); throw new RuntimeException("Unable to load plugin '" . $className . "': Class not found");
} }
} }
$className = get_class($plugin); $className = get_class($plugin);
if (!is_a($plugin, 'PicoPluginInterface')) { if (!is_a($plugin, 'PicoPluginInterface')) {
throw new RuntimeException( throw new RuntimeException(
"Manually loaded plugins must implement 'PicoPluginInterface', " "Unable to load plugin '" . $className . "': "
. "'" . $className . "' given" . "Manually loaded plugins must implement 'PicoPluginInterface'"
); );
} }
@ -1382,7 +1388,7 @@ class Pico
* *
* Deprecated events (as used by plugins not implementing * Deprecated events (as used by plugins not implementing
* {@link PicoPluginInterface}) are triggered by {@link PicoDeprecated}. * {@link PicoPluginInterface}) are triggered by {@link PicoDeprecated}.
* You MUST NOT trigger events of Pico's core through a plugin! * You MUST NOT trigger events of Pico's core with a plugin!
* *
* @see PicoPluginInterface * @see PicoPluginInterface
* @see AbstractPicoPlugin * @see AbstractPicoPlugin