Various fixes

Thanks @PontusHorn for spotting!
This commit is contained in:
Daniel Rudolf 2015-09-13 20:46:09 +02:00
parent a83b01ef4f
commit 71e7da28cc
3 changed files with 13 additions and 12 deletions

View file

@ -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
);
}
}

View file

@ -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 <http://symfony.com/doc/current/components/yaml/introduction.html>
* @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;
}
}

View file

@ -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)