|
From: <var...@us...> - 2023-07-14 09:19:37
|
Revision: 11048
http://sourceforge.net/p/phpwiki/code/11048
Author: vargenau
Date: 2023-07-14 09:19:32 +0000 (Fri, 14 Jul 2023)
Log Message:
-----------
plugin: PHP 7: add types for function arguments and return
Modified Paths:
--------------
trunk/lib/plugin/AddComment.php
trunk/lib/plugin/AllPages.php
trunk/lib/plugin/AllUsers.php
trunk/lib/plugin/AnalyseAccessLogSql.php
trunk/lib/plugin/AppendText.php
trunk/lib/plugin/AsciiMath.php
trunk/lib/plugin/AsciiSVG.php
trunk/lib/plugin/AtomFeed.php
trunk/lib/plugin/AuthorHistory.php
trunk/lib/plugin/BackLinks.php
trunk/lib/plugin/BlogArchives.php
trunk/lib/plugin/BlogJournal.php
trunk/lib/plugin/BoxRight.php
trunk/lib/plugin/CacheTest.php
trunk/lib/plugin/Calendar.php
trunk/lib/plugin/CalendarList.php
trunk/lib/plugin/Chart.php
trunk/lib/plugin/Comment.php
trunk/lib/plugin/CreateBib.php
trunk/lib/plugin/CreatePage.php
trunk/lib/plugin/CreateToc.php
trunk/lib/plugin/CurrentTime.php
trunk/lib/plugin/DebugAuthInfo.php
trunk/lib/plugin/DebugBackendInfo.php
trunk/lib/plugin/DebugGroupInfo.php
trunk/lib/plugin/DebugRetransform.php
trunk/lib/plugin/Diff.php
trunk/lib/plugin/DynamicIncludePage.php
trunk/lib/plugin/EditMetaData.php
trunk/lib/plugin/ExternalSearch.php
trunk/lib/plugin/FacebookLike.php
trunk/lib/plugin/FileInfo.php
trunk/lib/plugin/FoafViewer.php
trunk/lib/plugin/FullTextSearch.php
trunk/lib/plugin/FuzzyPages.php
trunk/lib/plugin/GoTo.php
trunk/lib/plugin/GoogleMaps.php
trunk/lib/plugin/GooglePlugin.php
trunk/lib/plugin/GraphViz.php
trunk/lib/plugin/HelloWorld.php
trunk/lib/plugin/HtmlConverter.php
trunk/lib/plugin/IncludePage.php
trunk/lib/plugin/IncludePages.php
trunk/lib/plugin/IncludeSiteMap.php
trunk/lib/plugin/IncludeTree.php
trunk/lib/plugin/InterWikiSearch.php
trunk/lib/plugin/JabberPresence.php
trunk/lib/plugin/LdapSearch.php
trunk/lib/plugin/LikePages.php
trunk/lib/plugin/LinkDatabase.php
trunk/lib/plugin/LinkSearch.php
trunk/lib/plugin/ListPages.php
trunk/lib/plugin/ListRelations.php
trunk/lib/plugin/ListSubpages.php
trunk/lib/plugin/MediawikiTable.php
trunk/lib/plugin/ModeratedPage.php
trunk/lib/plugin/MostPopular.php
trunk/lib/plugin/NewPagesPerUser.php
trunk/lib/plugin/NoCache.php
trunk/lib/plugin/OldStyleTable.php
trunk/lib/plugin/OrphanedPages.php
trunk/lib/plugin/PageDump.php
trunk/lib/plugin/PageGroup.php
trunk/lib/plugin/PageHistory.php
trunk/lib/plugin/PageInfo.php
trunk/lib/plugin/PageTrail.php
trunk/lib/plugin/PasswordReset.php
trunk/lib/plugin/PhotoAlbum.php
trunk/lib/plugin/PhpHighlight.php
trunk/lib/plugin/Ploticus.php
trunk/lib/plugin/PluginManager.php
trunk/lib/plugin/PopUp.php
trunk/lib/plugin/PopularNearby.php
trunk/lib/plugin/PopularTags.php
trunk/lib/plugin/PreferenceApp.php
trunk/lib/plugin/PrevNext.php
trunk/lib/plugin/Processing.php
trunk/lib/plugin/RandomPage.php
trunk/lib/plugin/RateIt.php
trunk/lib/plugin/RawHtml.php
trunk/lib/plugin/RecentChanges.php
trunk/lib/plugin/RecentComments.php
trunk/lib/plugin/RecentEdits.php
trunk/lib/plugin/RecentReferrers.php
trunk/lib/plugin/RedirectTo.php
trunk/lib/plugin/RelatedChanges.php
trunk/lib/plugin/RichTable.php
trunk/lib/plugin/RssFeed.php
trunk/lib/plugin/SearchHighlight.php
trunk/lib/plugin/SemanticRelations.php
trunk/lib/plugin/SemanticSearch.php
trunk/lib/plugin/SemanticSearchAdvanced.php
trunk/lib/plugin/SiteMap.php
trunk/lib/plugin/SpellCheck.php
trunk/lib/plugin/SqlResult.php
trunk/lib/plugin/SyncWiki.php
trunk/lib/plugin/SyntaxHighlighter.php
trunk/lib/plugin/SystemInfo.php
trunk/lib/plugin/TeX2png.php
trunk/lib/plugin/Template.php
trunk/lib/plugin/TexToPng.php
trunk/lib/plugin/TitleSearch.php
trunk/lib/plugin/Transclude.php
trunk/lib/plugin/TranslateText.php
trunk/lib/plugin/UnfoldSubpages.php
trunk/lib/plugin/UpLoad.php
trunk/lib/plugin/UriResolver.php
trunk/lib/plugin/UserPreferences.php
trunk/lib/plugin/UserRatings.php
trunk/lib/plugin/Video.php
trunk/lib/plugin/WantedPages.php
trunk/lib/plugin/WatchPage.php
trunk/lib/plugin/WhoIsOnline.php
trunk/lib/plugin/WikiAdminChown.php
trunk/lib/plugin/WikiAdminDeleteAcl.php
trunk/lib/plugin/WikiAdminPurge.php
trunk/lib/plugin/WikiAdminRemove.php
trunk/lib/plugin/WikiAdminRename.php
trunk/lib/plugin/WikiAdminSearchReplace.php
trunk/lib/plugin/WikiAdminSelect.php
trunk/lib/plugin/WikiAdminSetAcl.php
trunk/lib/plugin/WikiAdminSetAclSimple.php
trunk/lib/plugin/WikiAdminSetExternal.php
trunk/lib/plugin/WikiAdminUtils.php
trunk/lib/plugin/WikiBlog.php
trunk/lib/plugin/WikiForm.php
trunk/lib/plugin/WikiFormRich.php
trunk/lib/plugin/WikiForum.php
trunk/lib/plugin/WikiPoll.php
trunk/lib/plugin/WikiTranslation.php
trunk/lib/plugin/WikicreoleTable.php
trunk/lib/plugin/YouTube.php
trunk/lib/plugin/text2png.php
Modified: trunk/lib/plugin/AddComment.php
===================================================================
--- trunk/lib/plugin/AddComment.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/AddComment.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -36,7 +36,7 @@
class WikiPlugin_AddComment extends WikiPlugin_WikiBlog
{
- public function getDescription()
+ public function getDescription(): string
{
return sprintf(_("Show and add comments for %s."), '[pagename]');
}
@@ -55,7 +55,7 @@
// jshide - boolean - quick javascript expansion of the comments
// and addcomment box
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('pagename' => '[pagename]',
'order' => 'normal',
Modified: trunk/lib/plugin/AllPages.php
===================================================================
--- trunk/lib/plugin/AllPages.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/AllPages.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -32,12 +32,12 @@
class WikiPlugin_AllPages extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("List all pages in this wiki.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array_merge(
PageList::supportedArgs(),
Modified: trunk/lib/plugin/AllUsers.php
===================================================================
--- trunk/lib/plugin/AllUsers.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/AllUsers.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -35,12 +35,12 @@
class WikiPlugin_AllUsers extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("List all once authenticated users.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array_merge(
PageList::supportedArgs(),
Modified: trunk/lib/plugin/AnalyseAccessLogSql.php
===================================================================
--- trunk/lib/plugin/AnalyseAccessLogSql.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/AnalyseAccessLogSql.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -61,7 +61,7 @@
* @param array $args
* @return string
*/
- private function getQueryString(&$args)
+ private function getQueryString(array &$args): string
{
// extract any parametrised conditions from the arguments,
// in particular, how much history to select
@@ -258,7 +258,7 @@
);
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array(
'mode' => 'referring_domains',
@@ -272,7 +272,7 @@
);
}
- public function getDescription()
+ public function getDescription(): string
{
return _("Show summary information from the access log table.");
}
@@ -362,7 +362,7 @@
}
}
- private function getWhereConditions(&$args)
+ private function getWhereConditions(&$args): string
{
$where_conditions = '';
Modified: trunk/lib/plugin/AppendText.php
===================================================================
--- trunk/lib/plugin/AppendText.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/AppendText.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -35,12 +35,12 @@
class WikiPlugin_AppendText extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Append text to any page in this wiki.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('page' => '[pagename]',
'pages' => false,
@@ -51,7 +51,7 @@
);
}
- private function fallback($addtext, $oldtext, $notfound, $message)
+ private function fallback($addtext, $oldtext, $notfound, $message): string
{
$message->pushContent(sprintf(_("“%s” not found"), $notfound) . ". " .
_("Appending at the end.") . "\n");
Modified: trunk/lib/plugin/AsciiMath.php
===================================================================
--- trunk/lib/plugin/AsciiMath.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/AsciiMath.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -44,12 +44,12 @@
{
public $source;
- public function getDescription()
+ public function getDescription(): string
{
return _("Render ASCII Math as MathML.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array();
}
Modified: trunk/lib/plugin/AsciiSVG.php
===================================================================
--- trunk/lib/plugin/AsciiSVG.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/AsciiSVG.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -31,12 +31,12 @@
{
public $source;
- public function getDescription()
+ public function getDescription(): string
{
return _("Render inline ASCII SVG.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('width' => 200,
'height' => 200,
@@ -102,7 +102,7 @@
class AsciiSVG_HTML extends HtmlElement
{
- public function startTag()
+ public function startTag(): string
{
$start = "<" . $this->_tag;
$this->_setClasses();
Modified: trunk/lib/plugin/AtomFeed.php
===================================================================
--- trunk/lib/plugin/AtomFeed.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/AtomFeed.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -31,12 +31,12 @@
class WikiPlugin_AtomFeed extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _('Atom Aggregator Plugin.');
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array(
'feed' => "",
Modified: trunk/lib/plugin/AuthorHistory.php
===================================================================
--- trunk/lib/plugin/AuthorHistory.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/AuthorHistory.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -55,12 +55,12 @@
{
public $_args;
- public function getDescription()
+ public function getDescription(): string
{
return _("List all page revisions edited by one user with diff links, or show a PageHistory-like list of a single page for only one user.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
global $request;
return array('exclude' => '',
Modified: trunk/lib/plugin/BackLinks.php
===================================================================
--- trunk/lib/plugin/BackLinks.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/BackLinks.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -26,12 +26,12 @@
class WikiPlugin_BackLinks extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return sprintf(_("List all pages which link to %s."), '[pagename]');
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array_merge(
PageList::supportedArgs(),
Modified: trunk/lib/plugin/BlogArchives.php
===================================================================
--- trunk/lib/plugin/BlogArchives.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/BlogArchives.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -37,12 +37,12 @@
class WikiPlugin_BlogArchives extends WikiPlugin_WikiBlog
{
- public function getDescription()
+ public function getDescription(): string
{
return _("List blog months links for the current or ADMIN user.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return //array_merge
//(
Modified: trunk/lib/plugin/BlogJournal.php
===================================================================
--- trunk/lib/plugin/BlogJournal.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/BlogJournal.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -36,12 +36,12 @@
class WikiPlugin_BlogJournal extends WikiPlugin_WikiBlog
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Include latest blog entries for the current or ADMIN user.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('count' => 7,
'user' => '',
Modified: trunk/lib/plugin/BoxRight.php
===================================================================
--- trunk/lib/plugin/BoxRight.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/BoxRight.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -28,17 +28,17 @@
class WikiPlugin_BoxRight extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("A simple plugin for <div class=boxright> with wikimarkup.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array();
}
- public function managesValidators()
+ public function managesValidators(): bool
{
// The plugin output will only change if the plugin
// invocation (page text) changes --- so the necessary
Modified: trunk/lib/plugin/CacheTest.php
===================================================================
--- trunk/lib/plugin/CacheTest.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/CacheTest.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -42,7 +42,7 @@
{
/* --------- overwrite abstract methods ---------------- */
- public function getPluginType()
+ public function getPluginType(): int
{
return PLUGIN_CACHED_IMG_ONDEMAND;
}
@@ -52,7 +52,7 @@
return _('This is a simple example using WikiPluginCached.');
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('text' => $this->getDescription(),
'font' => '3',
@@ -101,7 +101,7 @@
return $text;
}
- public function getExpire($dbi, $argarray, $request)
+ public function getExpire($dbi, $argarray, $request): string
{
return '+600'; // 600 seconds life time
}
@@ -147,7 +147,7 @@
// we could have used the simple built-in text2img function
// instead of writing our own:
- public function lazy_produceGraphics($text, $font)
+ public function lazy_produceGraphics($text, $font): string
{
if ($font < 1 || $font > 5) {
$text = "Fontnr. (font=\"$font\") should be in range 1-5";
Modified: trunk/lib/plugin/Calendar.php
===================================================================
--- trunk/lib/plugin/Calendar.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/Calendar.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -41,12 +41,12 @@
private $_today;
public $_links;
- public function getDescription()
+ public function getDescription(): string
{
return _("Calendar");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('prefix' => '[pagename]' . '/',
'date_format' => '%Y-%m-%d',
@@ -66,7 +66,7 @@
* @param string $basepage The pagename the plugin is invoked from.
* @return array List of pagenames linked to (or false).
*/
- public function getWikiPageLinks($argstr, $basepage)
+ public function getWikiPageLinks($argstr, $basepage): array
{
if (isset($this->_links)) {
return $this->_links;
Modified: trunk/lib/plugin/CalendarList.php
===================================================================
--- trunk/lib/plugin/CalendarList.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/CalendarList.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -59,12 +59,12 @@
public $args;
public $_links;
- public function getDescription()
+ public function getDescription(): string
{
return _("CalendarList");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('prefix' => '[pagename]',
'date_format' => '%Y-%m-%d',
@@ -91,7 +91,7 @@
* @param string $basepage The pagename the plugin is invoked from.
* @return array List of pagenames linked to (or false).
*/
- public function getWikiPageLinks($argstr, $basepage)
+ public function getWikiPageLinks($argstr, $basepage): array
{
if (isset($this->_links)) {
return $this->_links;
@@ -127,7 +127,7 @@
return $timeTMP;
}
- private function _date($dbi, $time)
+ private function _date($dbi, $time): array
{
$args = &$this->args;
$date_string = strftime($args['date_format'], $time);
Modified: trunk/lib/plugin/Chart.php
===================================================================
--- trunk/lib/plugin/Chart.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/Chart.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -49,12 +49,12 @@
{
public $source;
- public function getDescription()
+ public function getDescription(): string
{
return _("Render SVG charts.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('width' => 200,
'height' => 200,
@@ -163,7 +163,7 @@
class SVG_HTML extends HtmlElement
{
- public function startTag()
+ public function startTag(): string
{
$start = "<" . $this->_tag;
$this->_setClasses();
Modified: trunk/lib/plugin/Comment.php
===================================================================
--- trunk/lib/plugin/Comment.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/Comment.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -39,13 +39,13 @@
class WikiPlugin_Comment extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Embed hidden comments in WikiPages.");
}
// No arguments here.
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array();
}
Modified: trunk/lib/plugin/CreateBib.php
===================================================================
--- trunk/lib/plugin/CreateBib.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/CreateBib.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -34,12 +34,12 @@
class WikiPlugin_CreateBib extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Automatically create a Bibtex file from linked pages.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('pagename' => '[pagename]'); // The page from which the BibTex file is generated
}
@@ -48,7 +48,7 @@
* @param array $content
* @return array
*/
- private function extractBibTeX($content)
+ private function extractBibTeX(array $content): array
{
$bib = array();
@@ -77,7 +77,7 @@
* @param array $content
* @return array
*/
- private function extractArticles($content)
+ private function extractArticles(array $content): array
{
$articles = array();
for ($i = 0; $i < count($content); $i++) {
@@ -96,7 +96,7 @@
* @param WikiDB_Page $thispage
* @param string $filename
*/
- private function dumpFile($thispage, $filename)
+ private function dumpFile($thispage, string $filename)
{
include_once 'lib/loadsave.php';
$mailified = MailifyPage($thispage);
Modified: trunk/lib/plugin/CreatePage.php
===================================================================
--- trunk/lib/plugin/CreatePage.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/CreatePage.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -39,12 +39,12 @@
class WikiPlugin_CreatePage extends WikiPlugin_Template
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Create a wiki page by the provided name.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('s' => false,
'initial_content' => '',
Modified: trunk/lib/plugin/CreateToc.php
===================================================================
--- trunk/lib/plugin/CreateToc.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/CreateToc.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -42,12 +42,12 @@
class WikiPlugin_CreateToc extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Create a Table of Contents and automatically link to headers.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array(
'extracollapse' => true, // provide an entry +/- link to collapse
@@ -77,7 +77,7 @@
}
}
- private function roman_counter($number)
+ private function roman_counter($number): string
{
$n = intval($number);
$result = '';
@@ -93,7 +93,7 @@
return $result;
}
- private function letter_counter($number)
+ private function letter_counter($number): string
{
if ($number <= 26) {
return chr(ord("A") + $number - 1);
@@ -121,7 +121,7 @@
}
// Get HTML header corresponding to current level (level is set of ! or =)
- private function getHeader($level)
+ private function getHeader($level): string
{
$count = substr_count($level, '!');
switch ($count) {
@@ -148,7 +148,7 @@
return "";
}
- private function quote($heading)
+ private function quote($heading): string
{
if (TOC_FULL_SYNTAX) {
$theading = TransformInline($heading);
@@ -262,7 +262,7 @@
$levels,
$firstlevelstyle,
$basepage
- )
+ ): array
{
if (!$levels) {
$levels = array(1, 2);
Modified: trunk/lib/plugin/CurrentTime.php
===================================================================
--- trunk/lib/plugin/CurrentTime.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/CurrentTime.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -54,13 +54,13 @@
class WikiPlugin_CurrentTime extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Display current time and date.");
}
// Establish default values for each of this plugin's arguments.
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('format' => '%Y-%m-%d %T');
}
Modified: trunk/lib/plugin/DebugAuthInfo.php
===================================================================
--- trunk/lib/plugin/DebugAuthInfo.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/DebugAuthInfo.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -34,12 +34,12 @@
class WikiPlugin_DebugAuthInfo extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Display general and user specific auth information.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('userid' => '');
}
@@ -143,7 +143,7 @@
}
// needed to store serialized objects-values only (perm, pref)
- private function obj2hash($obj, $exclude = array())
+ private function obj2hash($obj, $exclude = array()): array
{
$a = array();
$fields = get_object_vars($obj);
@@ -236,7 +236,7 @@
return $rows;
}
- private function buildConstHash($constants)
+ private function buildConstHash($constants): array
{
$hash = array();
foreach ($constants as $c) {
Modified: trunk/lib/plugin/DebugBackendInfo.php
===================================================================
--- trunk/lib/plugin/DebugBackendInfo.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/DebugBackendInfo.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -246,7 +246,7 @@
return $rows;
}
- private function _showvalue($val): RawXml
+ private function _showvalue($val)
{
return $val ? $val : HTML::raw(' ');
}
Modified: trunk/lib/plugin/DebugGroupInfo.php
===================================================================
--- trunk/lib/plugin/DebugGroupInfo.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/DebugGroupInfo.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -28,12 +28,12 @@
class WikiPlugin_DebugGroupInfo extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Show Group Information.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array();
}
Modified: trunk/lib/plugin/DebugRetransform.php
===================================================================
--- trunk/lib/plugin/DebugRetransform.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/DebugRetransform.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -28,12 +28,12 @@
class WikiPlugin_DebugRetransform extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return sprintf(_("Show a markup retransformation of page %s."), '[pagename]');
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('page' => '[pagename]');
}
Modified: trunk/lib/plugin/Diff.php
===================================================================
--- trunk/lib/plugin/Diff.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/Diff.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -34,7 +34,7 @@
class WikiPlugin_Diff extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Display differences between revisions.");
}
@@ -41,7 +41,7 @@
// Establish default values for each of this plugin's arguments.
// todo: makes only sense with more args.
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('pagename' => '[pagename]',
'versions' => false,
Modified: trunk/lib/plugin/DynamicIncludePage.php
===================================================================
--- trunk/lib/plugin/DynamicIncludePage.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/DynamicIncludePage.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -32,12 +32,12 @@
class WikiPlugin_DynamicIncludePage extends WikiPlugin_IncludePage
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Dynamically include the content from another wiki page.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array_merge(
WikiPlugin_IncludePage::getDefaultArguments(),
Modified: trunk/lib/plugin/EditMetaData.php
===================================================================
--- trunk/lib/plugin/EditMetaData.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/EditMetaData.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -47,12 +47,12 @@
{
public $_args;
- public function getDescription()
+ public function getDescription(): string
{
return sprintf(_("Edit metadata for %s."), '[pagename]');
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('page' => '[pagename]');
}
Modified: trunk/lib/plugin/ExternalSearch.php
===================================================================
--- trunk/lib/plugin/ExternalSearch.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/ExternalSearch.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -42,7 +42,7 @@
public $_name;
public $_s;
- public function getDescription()
+ public function getDescription(): string
{
return _("Redirect to an external web site based on form input.");
//fixme: better description
@@ -64,7 +64,7 @@
}
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('s' => false,
'formsize' => 30,
Modified: trunk/lib/plugin/FacebookLike.php
===================================================================
--- trunk/lib/plugin/FacebookLike.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/FacebookLike.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -32,12 +32,12 @@
class WikiPlugin_FacebookLike extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Display a Facebook Like button.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('width' => 450,
'height' => 35,
Modified: trunk/lib/plugin/FileInfo.php
===================================================================
--- trunk/lib/plugin/FileInfo.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/FileInfo.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -39,7 +39,7 @@
// you need to do:
// yum install php-process
if (!function_exists('posix_getpwuid')) {
- function posix_getpwuid()
+ function posix_getpwuid(): bool
{
return false;
}
@@ -46,7 +46,7 @@
}
if (!function_exists('posix_getgrgid')) {
- function posix_getgrgid()
+ function posix_getgrgid(): bool
{
return false;
}
@@ -54,12 +54,12 @@
class WikiPlugin_FileInfo extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Display file information like size, date... of uploaded files.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array(
'file' => false, // relative path from PHPWIKI_DIR. (required)
@@ -225,7 +225,7 @@
return $result;
}
- private function formatsize($n, $factor, $suffix)
+ private function formatsize($n, $factor, $suffix): string
{
if ($n > $factor) {
$b = $n / $factor;
@@ -235,7 +235,7 @@
return '';
}
- private function phonysize($a)
+ private function phonysize($a): string
{
$factor = 1024 * 1024 * 1024;
if ($a > $factor) {
Modified: trunk/lib/plugin/FoafViewer.php
===================================================================
--- trunk/lib/plugin/FoafViewer.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/FoafViewer.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -58,7 +58,7 @@
{
// The handler is handled okay. The only problem is that it still
// throws a fatal.
- private function error_handler($error)
+ private function error_handler($error): bool
{
if (strstr($error->errstr, "Failed opening required 'XML/FOAF/Parser.php'")) {
return true;
@@ -68,12 +68,12 @@
return false;
}
- public function getDescription()
+ public function getDescription(): string
{
return _("Parse an RDF FOAF file and extract information to render as HTML.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('foaf' => false, // the URI to parse
//'userid' => false,
@@ -214,7 +214,7 @@
* @todo Make sure it can look more than 1 layer deep
* @todo Pass in dublincore metadata
*/
- public function iterateHTML($array, $index, $dc = null)
+ public function iterateHTML(array $array, int $index, $dc = null)
{
for ($i = 0; $i < count($array[$index]); $i++) {
//Cater for different types
Modified: trunk/lib/plugin/FullTextSearch.php
===================================================================
--- trunk/lib/plugin/FullTextSearch.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/FullTextSearch.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -38,12 +38,12 @@
*/
class WikiPlugin_FullTextSearch extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Search the content of all pages in this wiki.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
// All PageList::supportedArgs, except 'pagename'
$args = array_merge(
@@ -190,7 +190,7 @@
* @param string $hilight_re
* @return array
*/
- public function showhits($page, $hilight_re)
+ public function showhits($page, string $hilight_re): array
{
$current = $page->getCurrentRevision();
$matches = preg_grep("/$hilight_re/i", $current->getContent());
@@ -205,7 +205,7 @@
return $html;
}
- public static function highlight_line($line, $hilight_re)
+ public static function highlight_line($line, $hilight_re): array
{
while (preg_match("/^(.*?)($hilight_re)/i", $line, $m)) {
$line = substr($line, strlen($m[0]));
Modified: trunk/lib/plugin/FuzzyPages.php
===================================================================
--- trunk/lib/plugin/FuzzyPages.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/FuzzyPages.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -40,7 +40,7 @@
private $searchterm_metaphone;
private $debug;
- public function getDescription()
+ public function getDescription(): string
{
return sprintf(
_("Search for page titles similar to %s."),
@@ -48,13 +48,13 @@
);
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('s' => '',
'debug' => false);
}
- private function spelling_similarity($subject)
+ private function spelling_similarity($subject): int
{
$spelling_similarity_score = 0;
similar_text(
@@ -65,7 +65,7 @@
return $spelling_similarity_score;
}
- private function sound_similarity($subject)
+ private function sound_similarity($subject): int
{
$sound_similarity_score = 0;
similar_text(
Modified: trunk/lib/plugin/GoTo.php
===================================================================
--- trunk/lib/plugin/GoTo.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/GoTo.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -34,12 +34,12 @@
class WikiPlugin_GoTo extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Go to or create page.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('size' => 32);
}
Modified: trunk/lib/plugin/GoogleMaps.php
===================================================================
--- trunk/lib/plugin/GoogleMaps.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/GoogleMaps.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -59,12 +59,12 @@
class WikiPlugin_GoogleMaps extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Display a marker with further infos (when clicking) on given coordinates.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array(
'Longitude' => '',
Modified: trunk/lib/plugin/GooglePlugin.php
===================================================================
--- trunk/lib/plugin/GooglePlugin.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/GooglePlugin.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -41,12 +41,12 @@
class WikiPlugin_GooglePlugin extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Make use of the Google API.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('q' => '',
'mode' => 'search', // or 'cache' or 'spell'
Modified: trunk/lib/plugin/GraphViz.php
===================================================================
--- trunk/lib/plugin/GraphViz.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/GraphViz.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -70,7 +70,7 @@
public $source;
public $_mapfile;
- private function mapTypes()
+ private function mapTypes(): array
{
return array("imap", "cmapx", "ismap", "cmap");
}
@@ -80,7 +80,7 @@
* or HTML if the imagetype is not supported by GD (EPS, SVG, SVGZ) (not yet)
* or IMG_INLINE if device = png, gif or jpeg
*/
- public function getPluginType()
+ public function getPluginType(): int
{
$type = $this->decideImgType($this->_args['imgtype']);
if ($type == $this->_args['imgtype']) {
@@ -108,12 +108,12 @@
return _("GraphViz image or imagemap creation of directed graphs.");
}
- public function managesValidators()
+ public function managesValidators(): bool
{
return true;
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array(
'imgtype' => 'png', // png,gif,svgz,svg,...
@@ -135,7 +135,7 @@
* functions are called seldomly) or to about two minutes
* if a help screen is created.
*/
- public function getExpire($dbi, $argarray, $request)
+ public function getExpire($dbi, $argarray, $request): string
{
if (!empty($argarray['help'])) {
return '+120';
@@ -152,7 +152,7 @@
* @param Request $request
* @return string 'png', 'jpeg', 'gif'
*/
- public function getImageType($dbi, $argarray, $request)
+ public function getImageType($dbi, $argarray, $request): string
{
return $argarray['imgtype'];
}
@@ -173,7 +173,7 @@
* TODO: *map features.
* @return string image handle
*/
- public function helpImage()
+ public function helpImage(): string
{
$def = $this->defaultArguments();
$imgtypes = $GLOBALS['PLUGIN_CACHED_IMGTYPES'];
@@ -206,7 +206,7 @@
);
}
- public function processSource($argarray = array())
+ public function processSource($argarray = array()): string
{
if (empty($this->source)) {
// create digraph from pages
@@ -249,7 +249,7 @@
* @param array $argarray
* @return mixed
*/
- public function createDotFile($tempfile = '', $argarray = array())
+ public function createDotFile(string $tempfile = '', array $argarray = array())
{
$this->source = $this->processSource($argarray);
if (!$this->source) {
@@ -348,12 +348,12 @@
*
* @return string
*/
- protected function pngArg()
+ protected function pngArg(): string
{
return 'imgtype';
}
- protected function getMap($dbi, $argarray, $request)
+ protected function getMap($dbi, $argarray, $request): array
{
$result = $this->invokeDot($argarray);
if (is_a($result, 'HtmlElement')) {
@@ -378,7 +378,7 @@
* @param label string not used anymore
* @return array
*/
- public function invokeDot($argarray)
+ public function invokeDot($argarray): array
{
/**
* @var WikiRequest $request
Modified: trunk/lib/plugin/HelloWorld.php
===================================================================
--- trunk/lib/plugin/HelloWorld.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/HelloWorld.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -42,13 +42,13 @@
class WikiPlugin_HelloWorld extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Simple Sample Plugin.");
}
// Establish default values for each of this plugin's arguments.
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('salutation' => "Hello",
'name' => "World");
Modified: trunk/lib/plugin/HtmlConverter.php
===================================================================
--- trunk/lib/plugin/HtmlConverter.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/HtmlConverter.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -34,12 +34,12 @@
class WikiPlugin_HtmlConverter extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Convert HTML markup into wiki markup.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array();
}
Modified: trunk/lib/plugin/IncludePage.php
===================================================================
--- trunk/lib/plugin/IncludePage.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/IncludePage.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -31,12 +31,12 @@
class WikiPlugin_IncludePage extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Include text from another wiki page.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array(
'page' => false, // the page to include
@@ -51,7 +51,7 @@
);
}
- public function getWikiPageLinks($argstr, $basepage)
+ public function getWikiPageLinks($argstr, $basepage): array
{
$args = $this->getArgs($argstr);
$page = isset($args['page']) ? $args['page'] : '';
@@ -224,7 +224,7 @@
* Handles the arguments: section, sectionhead, lines, words, bytes,
* for UnfoldSubpages, IncludePage, ...
*/
- protected function extractParts($c, $pagename, $args)
+ protected function extractParts($c, $pagename, $args): string
{
extract($args);
Modified: trunk/lib/plugin/IncludePages.php
===================================================================
--- trunk/lib/plugin/IncludePages.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/IncludePages.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -32,12 +32,12 @@
class WikiPlugin_IncludePages extends WikiPlugin_IncludePage
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Include multiple pages.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array_merge(
array('pages' => '', // the pages to include
@@ -46,7 +46,7 @@
);
}
- public function getWikiPageLinks($argstr, $basepage)
+ public function getWikiPageLinks($argstr, $basepage): array
{
$args = $this->getArgs($argstr);
if (is_string($args['exclude']) and !empty($args['exclude'])) {
Modified: trunk/lib/plugin/IncludeSiteMap.php
===================================================================
--- trunk/lib/plugin/IncludeSiteMap.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/IncludeSiteMap.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -49,12 +49,12 @@
class WikiPlugin_IncludeSiteMap extends WikiPlugin_SiteMap
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Include recursively all linked pages starting at [pagename].");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('exclude' => '',
'include_self' => false,
Modified: trunk/lib/plugin/IncludeTree.php
===================================================================
--- trunk/lib/plugin/IncludeTree.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/IncludeTree.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -36,12 +36,12 @@
class WikiPlugin_IncludeTree extends WikiPlugin_SiteMap
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Display Dynamic Category Tree.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('exclude' => '',
'include_self' => false,
Modified: trunk/lib/plugin/InterWikiSearch.php
===================================================================
--- trunk/lib/plugin/InterWikiSearch.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/InterWikiSearch.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -26,12 +26,12 @@
class WikiPlugin_InterWikiSearch extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Perform searches on InterWiki sites listed in InterWikiMap.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('s' => '',
'formsize' => 30,
Modified: trunk/lib/plugin/JabberPresence.php
===================================================================
--- trunk/lib/plugin/JabberPresence.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/JabberPresence.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -45,13 +45,13 @@
class WikiPlugin_JabberPresence extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Display Jabber presence.");
}
// Establish default values for each of this plugin's arguments.
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('scripturl' => "http://edgar.netflint.net/status.php",
'jid' => MY_JABBER_ID,
Modified: trunk/lib/plugin/LdapSearch.php
===================================================================
--- trunk/lib/plugin/LdapSearch.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/LdapSearch.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -51,12 +51,12 @@
class WikiPlugin_LdapSearch extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Search an LDAP directory.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('host' => "", // default: LDAP_AUTH_HOST
'port' => 389, // ignored if host = full uri
Modified: trunk/lib/plugin/LikePages.php
===================================================================
--- trunk/lib/plugin/LikePages.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/LikePages.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -27,7 +27,7 @@
class WikiPlugin_LikePages extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return sprintf(
_("List page names which share an initial or final title word with “%s”."),
@@ -35,7 +35,7 @@
);
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array_merge(
PageList::supportedArgs(),
@@ -133,7 +133,7 @@
return $pagelist;
}
- private function _quote($str)
+ private function _quote($str): string
{
return "'" . str_replace("'", "''", $str) . "'";
}
Modified: trunk/lib/plugin/LinkDatabase.php
===================================================================
--- trunk/lib/plugin/LinkDatabase.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/LinkDatabase.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -39,7 +39,7 @@
*/
class WikiPlugin_LinkDatabase extends WikiPluginCached
{
- public function getPluginType()
+ public function getPluginType(): int
{
return PLUGIN_CACHED_HTML;
}
@@ -49,12 +49,12 @@
return _("List all pages with all links in various formats for some Java Visualization tools.");
}
- public function getExpire($dbi, $argarray, $request)
+ public function getExpire($dbi, $argarray, $request): string
{
return '+900'; // 15 minutes
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array_merge(
PageList::supportedArgs(),
Modified: trunk/lib/plugin/LinkSearch.php
===================================================================
--- trunk/lib/plugin/LinkSearch.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/LinkSearch.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -35,12 +35,12 @@
{
public $current_row;
- public function getDescription()
+ public function getDescription(): string
{
return _("Search page and link names.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array_merge(
PageList::supportedArgs(), // paging and more.
Modified: trunk/lib/plugin/ListPages.php
===================================================================
--- trunk/lib/plugin/ListPages.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/ListPages.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -36,12 +36,12 @@
class WikiPlugin_ListPages extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("List pages that are explicitly given as the pages argument.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array_merge(
PageList::supportedArgs(),
Modified: trunk/lib/plugin/ListRelations.php
===================================================================
--- trunk/lib/plugin/ListRelations.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/ListRelations.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -32,12 +32,12 @@
class WikiPlugin_ListRelations extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Display the list of all defined relations and optionnally attributes in this entire wiki.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array_merge(
PageList::supportedArgs(), // paging and more.
Modified: trunk/lib/plugin/ListSubpages.php
===================================================================
--- trunk/lib/plugin/ListSubpages.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/ListSubpages.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -32,12 +32,12 @@
class WikiPlugin_ListSubpages extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Lists the names of all SubPages of the current page.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array_merge(
PageList::supportedArgs(),
Modified: trunk/lib/plugin/MediawikiTable.php
===================================================================
--- trunk/lib/plugin/MediawikiTable.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/MediawikiTable.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -54,12 +54,12 @@
class WikiPlugin_MediawikiTable extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Layout tables using a Mediawiki-like markup style.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array();
}
@@ -71,7 +71,7 @@
* @param string $basepage The pagename the plugin is invoked from.
* @return array List of pagenames linked to.
*/
- public function getWikiPageLinks($argstr, $basepage)
+ public function getWikiPageLinks($argstr, $basepage): array
{
return getTextLinks($argstr);
}
Modified: trunk/lib/plugin/ModeratedPage.php
===================================================================
--- trunk/lib/plugin/ModeratedPage.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/ModeratedPage.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -41,12 +41,12 @@
{
public $_tokens;
- public function getDescription()
+ public function getDescription(): string
{
return _("Support moderated pages.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('page' => '[pagename]',
'moderators' => false,
@@ -111,7 +111,7 @@
* @param string $argstr
* @return array
*/
- public function resolve_argstr(&$request, $argstr)
+ public function resolve_argstr(&$request, $argstr): array
{
$args = $this->getArgs($argstr);
$group = $request->getGroup();
@@ -169,7 +169,7 @@
* @param array $moderated
* @return bool|HtmlElement
*/
- public function lock_check(&$request, &$page, $moderated)
+ public function lock_check(&$request, &$page, array $moderated)
{
$action_page = $request->getPage(_("ModeratedPage"));
$status = $this->getSiteStatus($request, $action_page);
@@ -253,7 +253,7 @@
* @param WikiDB_Page $page
* @return bool
*/
- public function handler(&$request, &$page)
+ public function handler(&$request, &$page): bool
{
$action = $request->getArg('action');
$moderated = $page->get('moderated');
@@ -349,7 +349,7 @@
* @param array $moderation
* @return HtmlElement|string
*/
- public function approve(&$request, $args, &$moderation)
+ public function approve(&$request, array $args, array &$moderation)
{
if ($request->isPost()) {
// this is unsafe because we dont know if it will succeed. but we tried.
@@ -387,7 +387,7 @@
* @param array $moderation
* @return HtmlElement|string
*/
- public function reject(&$request, $args, &$moderation)
+ public function reject(&$request, array $args, array &$moderation)
{
// check id, delete action
if ($request->isPost()) {
@@ -404,7 +404,7 @@
* @param array $args
* @param array $moderation
*/
- public function cleanup_and_notify(&$request, $args, &$moderation)
+ public function cleanup_and_notify(&$request, array $args, array &$moderation)
{
$pagename = $moderation['args']['pagename'];
$page = $request->_dbi->getPage($pagename);
@@ -446,7 +446,7 @@
* @param string $pass
* @return HtmlElement
*/
- private function approval_form(&$request, $args, $moderation, $pass = 'approve')
+ private function approval_form(&$request, array $args, array $moderation, string $pass = 'approve')
{
$header = HTML::h3(_("Please approve or reject this request:"));
Modified: trunk/lib/plugin/MostPopular.php
===================================================================
--- trunk/lib/plugin/MostPopular.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/MostPopular.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -27,12 +27,12 @@
class WikiPlugin_MostPopular extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("List the most popular pages.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array_merge(
PageList::supportedArgs(),
Modified: trunk/lib/plugin/NewPagesPerUser.php
===================================================================
--- trunk/lib/plugin/NewPagesPerUser.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/NewPagesPerUser.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -32,7 +32,7 @@
class WikiPlugin_NewPagesPerUser extends WikiPlugin
{
- private function cmp_by_count($a, $b)
+ private function cmp_by_count($a, $b): int
{
if ($a['count'] == $b['count']) {
return 0;
@@ -40,12 +40,12 @@
return $a['count'] < $b['count'] ? 1 : -1;
}
- public function getDescription()
+ public function getDescription(): string
{
return _("List all new pages per month per user.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('userid' => '',
'month' => '',
Modified: trunk/lib/plugin/NoCache.php
===================================================================
--- trunk/lib/plugin/NoCache.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/NoCache.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -38,12 +38,12 @@
class WikiPlugin_NoCache extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Don't cache this page.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array('nocache' => 1);
}
Modified: trunk/lib/plugin/OldStyleTable.php
===================================================================
--- trunk/lib/plugin/OldStyleTable.php 2023-07-13 19:30:51 UTC (rev 11047)
+++ trunk/lib/plugin/OldStyleTable.php 2023-07-14 09:19:32 UTC (rev 11048)
@@ -47,12 +47,12 @@
class WikiPlugin_OldStyleTable extends WikiPlugin
{
- public function getDescription()
+ public function getDescription(): string
{
return _("Layout tables using the old markup style.");
}
- public function getDefaultArguments()
+ public function getDefaultArguments(): array
{
return array(
'caption' => '',
@@ -69,7 +69,7 @@
* @param stri...
[truncated message content] |