Improve type hinting
This commit is contained in:
parent
2982f5deb9
commit
840d41bca5
5 changed files with 24 additions and 24 deletions
|
@ -1031,7 +1031,7 @@ class Pico
|
|||
*
|
||||
* @see Pico::readPages()
|
||||
* @see Pico::sortPages()
|
||||
* @return array|null the data of all pages
|
||||
* @return array[]|null the data of all pages
|
||||
*/
|
||||
public function getPages()
|
||||
{
|
||||
|
|
|
@ -67,7 +67,7 @@ class PicoDeprecated extends AbstractPicoPlugin
|
|||
*
|
||||
* @see DummyPlugin::onPluginsLoaded()
|
||||
*/
|
||||
public function onPluginsLoaded(&$plugins)
|
||||
public function onPluginsLoaded(array &$plugins)
|
||||
{
|
||||
if (!empty($plugins)) {
|
||||
foreach ($plugins as $plugin) {
|
||||
|
@ -110,7 +110,7 @@ class PicoDeprecated extends AbstractPicoPlugin
|
|||
* @param mixed[] &$realConfig array of config variables
|
||||
* @return void
|
||||
*/
|
||||
public function onConfigLoaded(&$realConfig)
|
||||
public function onConfigLoaded(array &$realConfig)
|
||||
{
|
||||
global $config;
|
||||
|
||||
|
@ -167,7 +167,7 @@ class PicoDeprecated extends AbstractPicoPlugin
|
|||
* @param mixed[] &$realConfig array of config variables
|
||||
* @return void
|
||||
*/
|
||||
protected function loadRootDirConfig(&$realConfig)
|
||||
protected function loadRootDirConfig(array &$realConfig)
|
||||
{
|
||||
if (file_exists($this->getRootDir() . 'config.php')) {
|
||||
// config.php in Pico::$rootDir is deprecated
|
||||
|
@ -284,7 +284,7 @@ class PicoDeprecated extends AbstractPicoPlugin
|
|||
*
|
||||
* @see DummyPlugin::onMetaHeaders()
|
||||
*/
|
||||
public function onMetaHeaders(&$headers)
|
||||
public function onMetaHeaders(array &$headers)
|
||||
{
|
||||
$this->triggerEvent('before_read_file_meta', array(&$headers));
|
||||
}
|
||||
|
@ -294,7 +294,7 @@ class PicoDeprecated extends AbstractPicoPlugin
|
|||
*
|
||||
* @see DummyPlugin::onMetaParsed()
|
||||
*/
|
||||
public function onMetaParsed(&$meta)
|
||||
public function onMetaParsed(array &$meta)
|
||||
{
|
||||
$this->triggerEvent('file_meta', array(&$meta));
|
||||
}
|
||||
|
@ -328,7 +328,7 @@ class PicoDeprecated extends AbstractPicoPlugin
|
|||
*
|
||||
* @see DummyPlugin::onSinglePageLoaded()
|
||||
*/
|
||||
public function onSinglePageLoaded(&$pageData)
|
||||
public function onSinglePageLoaded(array &$pageData)
|
||||
{
|
||||
$this->triggerEvent('get_page_data', array(&$pageData, $pageData['meta']));
|
||||
}
|
||||
|
@ -344,7 +344,7 @@ class PicoDeprecated extends AbstractPicoPlugin
|
|||
*
|
||||
* @see DummyPlugin::onPagesLoaded()
|
||||
*/
|
||||
public function onPagesLoaded(&$pages, &$currentPage, &$previousPage, &$nextPage)
|
||||
public function onPagesLoaded(array &$pages, array &$currentPage = null, array &$previousPage = null, array &$nextPage = null)
|
||||
{
|
||||
// remove keys of pages array
|
||||
$plainPages = array();
|
||||
|
@ -391,7 +391,7 @@ class PicoDeprecated extends AbstractPicoPlugin
|
|||
*
|
||||
* @see DummyPlugin::onPageRendering()
|
||||
*/
|
||||
public function onPageRendering(&$twig, &$twigVariables, &$templateName)
|
||||
public function onPageRendering(Twig_Environment &$twig, array &$twigVariables, &$templateName)
|
||||
{
|
||||
// template name contains file extension since Pico 1.0
|
||||
$fileExtension = '';
|
||||
|
|
|
@ -30,7 +30,7 @@ class PicoParsePagesContent extends AbstractPicoPlugin
|
|||
*
|
||||
* @see DummyPlugin::onSinglePageLoaded()
|
||||
*/
|
||||
public function onSinglePageLoaded(&$pageData)
|
||||
public function onSinglePageLoaded(array &$pageData)
|
||||
{
|
||||
if (!isset($pageData['content'])) {
|
||||
$pageData['content'] = $this->prepareFileContent($pageData['raw_content'], $pageData['meta']);
|
||||
|
|
|
@ -40,7 +40,7 @@ class PicoExcerpt extends AbstractPicoPlugin
|
|||
*
|
||||
* @see DummyPlugin::onConfigLoaded()
|
||||
*/
|
||||
public function onConfigLoaded(&$config)
|
||||
public function onConfigLoaded(array &$config)
|
||||
{
|
||||
if (!isset($config['excerpt_length'])) {
|
||||
$config['excerpt_length'] = 50;
|
||||
|
@ -53,7 +53,7 @@ class PicoExcerpt extends AbstractPicoPlugin
|
|||
* @see PicoExcerpt::createExcerpt()
|
||||
* @see DummyPlugin::onSinglePageLoaded()
|
||||
*/
|
||||
public function onSinglePageLoaded(&$pageData)
|
||||
public function onSinglePageLoaded(array &$pageData)
|
||||
{
|
||||
if (!isset($pageData['excerpt'])) {
|
||||
$pageData['excerpt'] = $this->createExcerpt(
|
||||
|
|
|
@ -40,7 +40,7 @@ class DummyPlugin extends AbstractPicoPlugin
|
|||
* @param object[] &$plugins loaded plugin instances
|
||||
* @return void
|
||||
*/
|
||||
public function onPluginsLoaded(&$plugins)
|
||||
public function onPluginsLoaded(array &$plugins)
|
||||
{
|
||||
// your code
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ class DummyPlugin extends AbstractPicoPlugin
|
|||
* @param mixed[] &$config array of config variables
|
||||
* @return void
|
||||
*/
|
||||
public function onConfigLoaded(&$config)
|
||||
public function onConfigLoaded(array &$config)
|
||||
{
|
||||
// your code
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ class DummyPlugin extends AbstractPicoPlugin
|
|||
* array key is later used to access the found value
|
||||
* @return void
|
||||
*/
|
||||
public function onMetaHeaders(&$headers)
|
||||
public function onMetaHeaders(array &$headers)
|
||||
{
|
||||
// your code
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ class DummyPlugin extends AbstractPicoPlugin
|
|||
* @param string[] &$headers known meta header fields
|
||||
* @return void
|
||||
*/
|
||||
public function onMetaParsing(&$rawContent, &$headers)
|
||||
public function onMetaParsing(&$rawContent, array &$headers)
|
||||
{
|
||||
// your code
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ class DummyPlugin extends AbstractPicoPlugin
|
|||
* @param string[] &$meta parsed meta data
|
||||
* @return void
|
||||
*/
|
||||
public function onMetaParsed(&$meta)
|
||||
public function onMetaParsed(array &$meta)
|
||||
{
|
||||
// your code
|
||||
}
|
||||
|
@ -249,7 +249,7 @@ class DummyPlugin extends AbstractPicoPlugin
|
|||
* @param array &$pageData data of the loaded page
|
||||
* @return void
|
||||
*/
|
||||
public function onSinglePageLoaded(&$pageData)
|
||||
public function onSinglePageLoaded(array &$pageData)
|
||||
{
|
||||
// your code
|
||||
}
|
||||
|
@ -264,13 +264,13 @@ class DummyPlugin extends AbstractPicoPlugin
|
|||
* @see Pico::getCurrentPage()
|
||||
* @see Pico::getPreviousPage()
|
||||
* @see Pico::getNextPage()
|
||||
* @param array &$pages data of all known pages
|
||||
* @param array &$currentPage data of the page being served
|
||||
* @param array &$previousPage data of the previous page
|
||||
* @param array &$nextPage data of the next page
|
||||
* @param array[] &$pages data of all known pages
|
||||
* @param array|null &$currentPage data of the page being served
|
||||
* @param array|null &$previousPage data of the previous page
|
||||
* @param array|null &$nextPage data of the next page
|
||||
* @return void
|
||||
*/
|
||||
public function onPagesLoaded(&$pages, &$currentPage, &$previousPage, &$nextPage)
|
||||
public function onPagesLoaded(array &$pages, array &$currentPage = null, array &$previousPage = null, array &$nextPage = null)
|
||||
{
|
||||
// your code
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ class DummyPlugin extends AbstractPicoPlugin
|
|||
* @param string &$templateName file name of the template
|
||||
* @return void
|
||||
*/
|
||||
public function onPageRendering(&$twig, &$twigVariables, &$templateName)
|
||||
public function onPageRendering(Twig_Environment &$twig, array &$twigVariables, &$templateName)
|
||||
{
|
||||
// your code
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue