From: Roland Haeder Date: Sat, 12 Sep 2015 06:36:56 +0000 (+0200) Subject: Added type-hint (checked!) X-Git-Url: https://git.mxchange.org/?p=quix0rs-gnu-social.git;a=commitdiff_plain;h=bc1f9eb3a551bcd0ab74911791087380a16d40e0 Added type-hint (checked!) Signed-off-by: Roland Haeder --- diff --git a/lib/attachmentlist.php b/lib/attachmentlist.php index a784066fda..19ca5711c8 100644 --- a/lib/attachmentlist.php +++ b/lib/attachmentlist.php @@ -58,7 +58,7 @@ class AttachmentList extends Widget * * @param Notice $notice stream of notices from DB_DataObject */ - function __construct($notice, $out=null) + function __construct(Notice $notice, Action $out=null) { parent::__construct($out); $this->notice = $notice; diff --git a/lib/command.php b/lib/command.php index 830b97ee23..4b7f1c4f7e 100644 --- a/lib/command.php +++ b/lib/command.php @@ -795,7 +795,7 @@ class SubscriptionsCommand extends Command $out .= ' '; $out .= implode(', ',$nicknames); } - $channel->output($this->user,$out); + $channel->output($this->user, $out); } } @@ -822,7 +822,7 @@ class SubscribersCommand extends Command $out .= ' '; $out .= implode(', ',$nicknames); } - $channel->output($this->user,$out); + $channel->output($this->user, $out); } } @@ -848,7 +848,7 @@ class GroupsCommand extends Command count($nicknames)); $out.=implode(', ',$groups); } - $channel->output($this->user,$out); + $channel->output($this->user, $out); } } diff --git a/lib/noticelist.php b/lib/noticelist.php index 727be89bc6..317c7a3f03 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -65,7 +65,7 @@ class NoticeList extends Widget * * @param Notice $notice stream of notices from DB_DataObject */ - function __construct(Notice $notice, $out=null, array $prefs=array()) + function __construct(Notice $notice, Action $out=null, array $prefs=array()) { parent::__construct($out); $this->notice = $notice; diff --git a/lib/peopletaglist.php b/lib/peopletaglist.php index b2f2dcca46..d8d4b6db69 100644 --- a/lib/peopletaglist.php +++ b/lib/peopletaglist.php @@ -102,7 +102,7 @@ class PeopletagListItem extends Widget * * @param Notice $notice The notice we'll display */ - function __construct($peopletag, $current, $out=null) + function __construct($peopletag, $current, Action $out=null) { parent::__construct($out); $this->peopletag = $peopletag; diff --git a/lib/pluginlist.php b/lib/pluginlist.php index 40a889abd5..038b08a18f 100644 --- a/lib/pluginlist.php +++ b/lib/pluginlist.php @@ -31,8 +31,8 @@ if (!defined('STATUSNET')) { exit(1); } -require INSTALLDIR . "/lib/pluginenableform.php"; -require INSTALLDIR . "/lib/plugindisableform.php"; +require INSTALLDIR . '/lib/pluginenableform.php'; +require INSTALLDIR . '/lib/plugindisableform.php'; /** * Plugin list @@ -47,7 +47,7 @@ class PluginList extends Widget { var $plugins = array(); - function __construct($plugins, $out) + function __construct(array $plugins, Action $out=null) { parent::__construct($out); $this->plugins = $plugins; @@ -73,6 +73,9 @@ class PluginList extends Widget function showPlugins() { foreach ($this->plugins as $plugin) { + // Some check on instance + assert($plugin instanceof Plugin); + $pli = $this->newListItem($plugin); $pli->show(); } @@ -92,7 +95,7 @@ class PluginListItem extends Widget /** Local cache for plugin version info */ protected static $versions = false; - function __construct($plugin, $out) + function __construct($plugin, Action $out=null) { parent::__construct($out); $this->plugin = $plugin; diff --git a/lib/threadednoticelist.php b/lib/threadednoticelist.php index ebf0a46089..7f938df46e 100644 --- a/lib/threadednoticelist.php +++ b/lib/threadednoticelist.php @@ -261,7 +261,7 @@ class ThreadedNoticeListSubItem extends NoticeListItem { protected $root = null; - function __construct(Notice $notice, $root, $out) + function __construct(Notice $notice, $root, Action $out=null) { $this->root = $root; parent::__construct($notice, $out);