From 71e7da28cc98eb5f668c41a9ce2b7b19be962156 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Sun, 13 Sep 2015 20:46:09 +0200 Subject: [PATCH] Various fixes Thanks @PontusHorn for spotting! --- lib/AbstractPicoPlugin.php | 6 +++--- lib/Pico.php | 17 +++++++++-------- plugins/DummyPlugin.php | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/lib/AbstractPicoPlugin.php b/lib/AbstractPicoPlugin.php index ef47cc4..790a656 100644 --- a/lib/AbstractPicoPlugin.php +++ b/lib/AbstractPicoPlugin.php @@ -209,17 +209,17 @@ abstract class AbstractPicoPlugin implements IPicoPlugin } else { throw new RuntimeException( "Unable to disable plugin '" . get_called_class() . "': " - + "Required by manually enabled plugin '" . $pluginName . "'" + . "Required by manually enabled plugin '" . $pluginName . "'" ); } } } } else { $dependantsList = 'plugin' . ((count($dependants) > 1) ? 's' : '') . ' '; - $dependantsList .= "'" + implode("', '", array_keys($dependants)) + "'"; + $dependantsList .= "'" . implode("', '", array_keys($dependants)) . "'"; throw new RuntimeException( "Unable to disable plugin '" . get_called_class() . "': " - + "Required by " . $dependantsList + . "Required by " . $dependantsList ); } } diff --git a/lib/Pico.php b/lib/Pico.php index aff3dee..9ae862f 100644 --- a/lib/Pico.php +++ b/lib/Pico.php @@ -228,7 +228,7 @@ class Pico * Loads plugins from PLUGINS_DIR in alphabetical order * * Plugin files may be prefixed by a number (e.g. 00-PicoDeprecated.php) - * to indicate their processsing order. You MUST NOT use prefixes between + * to indicate their processing order. You MUST NOT use prefixes between * 00 and 19 (reserved for built-in plugins). * * @return void @@ -497,9 +497,9 @@ class Pico * ignored and won't be returned. * * @see - * @param string $content the raw file contents - * @param array $headers a array containing the known headers - * @return array parsed meta data + * @param string $rawContent the raw file contents + * @param array $headers a array containing the known headers + * @return array parsed meta data */ public function parseFileMeta($rawContent, array $headers) { @@ -887,9 +887,10 @@ class Pico * Recursively walks through a directory and returns all containing files * matching the specified file extension in alphabetical order * - * @param string $directory start directory - * @param string $ext return files with this file extension only (optional) - * @return array list of found files + * @param string $directory start directory + * @param string $fileExtension return files with the given file extension + * only (optional) + * @return array list of found files */ protected function getFiles($directory, $fileExtension = '') { @@ -910,7 +911,7 @@ class Pico if (is_dir($directory . '/' . $file)) { // get files recursively $result = array_merge($result, $this->getFiles($directory . '/' . $file, $fileExtension)); - } elseif (empty($fileExtension) || (substr($file, -strlen($fileExtension)) === $fileExtension)) { + } elseif (empty($fileExtension) || (substr($file, -$fileExtensionLength) === $fileExtension)) { $result[] = $directory . '/' . $file; } } diff --git a/plugins/DummyPlugin.php b/plugins/DummyPlugin.php index 46b0d9f..70133c7 100644 --- a/plugins/DummyPlugin.php +++ b/plugins/DummyPlugin.php @@ -193,7 +193,7 @@ class DummyPlugin extends AbstractPicoPlugin * Triggered after Pico parsed the contents of the file to serve * * @see Pico::getFileContent() - * @param stirng &$content parsed contents + * @param string &$content parsed contents * @return void */ public function onContentParsed(&$content)