From 1269e3f22315ab7bb2d4c355fb8b655f2db41b0b Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Sun, 15 Feb 2015 22:43:20 +0100 Subject: [PATCH] Fixed more type-hints for safety. Signed-off-by: Roland Haeder --- plugins/ActivitySpam/ActivitySpamPlugin.php | 2 +- plugins/AnonymousFave/AnonymousFavePlugin.php | 4 ++-- plugins/Autocomplete/AutocompletePlugin.php | 2 +- plugins/Blog/BlogPlugin.php | 2 +- plugins/Bookmark/BookmarkPlugin.php | 4 ++-- plugins/ClientSideShorten/ClientSideShortenPlugin.php | 2 +- plugins/DirectionDetector/DirectionDetectorPlugin.php | 2 +- plugins/Event/EventPlugin.php | 4 ++-- plugins/FacebookBridge/FacebookBridgePlugin.php | 2 +- plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php | 4 ++-- .../GNUsocialProfileExtensionsPlugin.php | 4 ++-- plugins/GoogleAnalytics/GoogleAnalyticsPlugin.php | 2 +- plugins/InfiniteScroll/InfiniteScrollPlugin.php | 2 +- plugins/LinkPreview/LinkPreviewPlugin.php | 2 +- plugins/Mapstraction/MapstractionPlugin.php | 2 +- plugins/Mapstraction/actions/map.php | 2 +- plugins/MobileProfile/MobileProfilePlugin.php | 2 +- .../OpenExternalLinkTargetPlugin.php | 2 +- plugins/PiwikAnalytics/PiwikAnalyticsPlugin.php | 2 +- plugins/Poll/PollPlugin.php | 2 +- plugins/QnA/QnAPlugin.php | 4 ++-- plugins/Realtime/RealtimePlugin.php | 8 ++++---- plugins/Recaptcha/RecaptchaPlugin.php | 4 ++-- plugins/RegisterThrottle/RegisterThrottlePlugin.php | 2 +- plugins/SiteNoticeInSidebar/SiteNoticeInSidebarPlugin.php | 4 ++-- plugins/TabFocus/TabFocusPlugin.php | 2 +- plugins/TinyMCE/TinyMCEPlugin.php | 4 ++-- plugins/UserLimit/UserLimitPlugin.php | 2 +- 28 files changed, 40 insertions(+), 40 deletions(-) diff --git a/plugins/ActivitySpam/ActivitySpamPlugin.php b/plugins/ActivitySpam/ActivitySpamPlugin.php index 9d61b2dddd..ae4bf9a7fb 100644 --- a/plugins/ActivitySpam/ActivitySpamPlugin.php +++ b/plugins/ActivitySpam/ActivitySpamPlugin.php @@ -191,7 +191,7 @@ class ActivitySpamPlugin extends Plugin return true; } - function onEndShowStyles($action) + function onEndShowStyles(Action $action) { $action->element('style', null, '.form-train-spam input.submit { background: url('.$this->path('icons/bullet_black.png').') no-repeat 0px 0px } ' . "\n" . diff --git a/plugins/AnonymousFave/AnonymousFavePlugin.php b/plugins/AnonymousFave/AnonymousFavePlugin.php index 841b652401..7d2f29c568 100644 --- a/plugins/AnonymousFave/AnonymousFavePlugin.php +++ b/plugins/AnonymousFave/AnonymousFavePlugin.php @@ -85,7 +85,7 @@ class AnonymousFavePlugin extends Plugin return true; } - function onEndShowHTML($action) + function onEndShowHTML(Action $action) { if (!common_logged_in()) { // Set a place to return to when submitting forms @@ -93,7 +93,7 @@ class AnonymousFavePlugin extends Plugin } } - function onEndShowScripts($action) + function onEndShowScripts(Action $action) { // Setup ajax calls for favoriting. Usually this is only done when // a user is logged in. diff --git a/plugins/Autocomplete/AutocompletePlugin.php b/plugins/Autocomplete/AutocompletePlugin.php index 380ab5a5dc..0d3fdfc91d 100644 --- a/plugins/Autocomplete/AutocompletePlugin.php +++ b/plugins/Autocomplete/AutocompletePlugin.php @@ -39,7 +39,7 @@ class AutocompletePlugin extends Plugin parent::__construct(); } - function onEndShowScripts($action){ + function onEndShowScripts(Action $action){ if (common_logged_in()) { $action->element('span', array('id' => 'autocomplete-api', 'data-url' => common_local_url('autocomplete'))); diff --git a/plugins/Blog/BlogPlugin.php b/plugins/Blog/BlogPlugin.php index 5f377186fe..723146221c 100644 --- a/plugins/Blog/BlogPlugin.php +++ b/plugins/Blog/BlogPlugin.php @@ -189,7 +189,7 @@ class BlogPlugin extends MicroAppPlugin return null; } - function onEndShowScripts($action) + function onEndShowScripts(Action $action) { $action->script(common_path('plugins/TinyMCE/js/jquery.tinymce.js')); $action->inlineScript('var _tinymce_path = "'.common_path('plugins/TinyMCE/js/tiny_mce.js').'";'."\n". diff --git a/plugins/Bookmark/BookmarkPlugin.php b/plugins/Bookmark/BookmarkPlugin.php index a3dc196e78..65fd7eeaf7 100644 --- a/plugins/Bookmark/BookmarkPlugin.php +++ b/plugins/Bookmark/BookmarkPlugin.php @@ -94,13 +94,13 @@ class BookmarkPlugin extends MicroAppPlugin * * @return boolean hook value */ - function onEndShowStyles($action) + function onEndShowStyles(Action $action) { $action->cssLink($this->path('css/bookmark.css')); return true; } - function onEndShowScripts($action) + function onEndShowScripts(Action $action) { $action->script($this->path('js/bookmark.js')); return true; diff --git a/plugins/ClientSideShorten/ClientSideShortenPlugin.php b/plugins/ClientSideShorten/ClientSideShortenPlugin.php index 94629a07b0..9dd3b1f515 100644 --- a/plugins/ClientSideShorten/ClientSideShortenPlugin.php +++ b/plugins/ClientSideShorten/ClientSideShortenPlugin.php @@ -38,7 +38,7 @@ class ClientSideShortenPlugin extends Plugin parent::__construct(); } - function onEndShowScripts($action){ + function onEndShowScripts(Action $action){ if (common_logged_in()) { $user = common_current_user(); $action->inlineScript('var maxNoticeLength = ' . User_urlshortener_prefs::maxNoticeLength($user)); diff --git a/plugins/DirectionDetector/DirectionDetectorPlugin.php b/plugins/DirectionDetector/DirectionDetectorPlugin.php index 561d38cd38..289196b4a9 100644 --- a/plugins/DirectionDetector/DirectionDetectorPlugin.php +++ b/plugins/DirectionDetector/DirectionDetectorPlugin.php @@ -118,7 +118,7 @@ class DirectionDetectorPlugin extends Plugin { * * @param Action $action */ - function onEndShowScripts($action){ + function onEndShowScripts(Action $action){ if (common_logged_in()) { $action->script($this->path('jquery.DirectionDetector.js')); } diff --git a/plugins/Event/EventPlugin.php b/plugins/Event/EventPlugin.php index 54046d57d5..3afab5f13b 100644 --- a/plugins/Event/EventPlugin.php +++ b/plugins/Event/EventPlugin.php @@ -291,12 +291,12 @@ class EventPlugin extends MicroAppPlugin } } - function onEndShowScripts($action) + function onEndShowScripts(Action $action) { $action->script($this->path('js/event.js')); } - function onEndShowStyles($action) + function onEndShowStyles(Action $action) { $action->cssLink($this->path('css/event.css')); return true; diff --git a/plugins/FacebookBridge/FacebookBridgePlugin.php b/plugins/FacebookBridge/FacebookBridgePlugin.php index f6f519ed34..9618eee31c 100644 --- a/plugins/FacebookBridge/FacebookBridgePlugin.php +++ b/plugins/FacebookBridge/FacebookBridgePlugin.php @@ -329,7 +329,7 @@ class FacebookBridgePlugin extends Plugin * @param Action $action the current action * */ - function onEndShowScripts($action) + function onEndShowScripts(Action $action) { if ($this->needsScripts($action)) { diff --git a/plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php b/plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php index 986b5457a6..906509fef5 100644 --- a/plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php +++ b/plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php @@ -157,12 +157,12 @@ class GNUsocialPhotosPlugin extends Plugin _('Photo gallery'), $nav->action->trimmed('action') == 'photos', 'nav_photos'); } - function onEndShowStyles($action) + function onEndShowStyles(Action $action) { $action->cssLink('/plugins/GNUsocialPhotos/res/style.css'); } - function onEndShowScripts($action) + function onEndShowScripts(Action $action) { $action->script('plugins/GNUsocialPhotos/res/gnusocialphotos.js'); } diff --git a/plugins/GNUsocialProfileExtensions/GNUsocialProfileExtensionsPlugin.php b/plugins/GNUsocialProfileExtensions/GNUsocialProfileExtensionsPlugin.php index abef3f47cf..fcf7e87366 100644 --- a/plugins/GNUsocialProfileExtensions/GNUsocialProfileExtensionsPlugin.php +++ b/plugins/GNUsocialProfileExtensions/GNUsocialProfileExtensionsPlugin.php @@ -102,12 +102,12 @@ class GNUsocialProfileExtensionsPlugin extends Plugin } } - function onEndShowStyles($action) + function onEndShowStyles(Action $action) { $action->cssLink('/plugins/GNUsocialProfileExtensions/res/style.css'); } - function onEndShowScripts($action) + function onEndShowScripts(Action $action) { $action->script('plugins/GNUsocialProfileExtensions/js/profile.js'); } diff --git a/plugins/GoogleAnalytics/GoogleAnalyticsPlugin.php b/plugins/GoogleAnalytics/GoogleAnalyticsPlugin.php index 1dc0f0f07a..2f07747a4d 100644 --- a/plugins/GoogleAnalytics/GoogleAnalyticsPlugin.php +++ b/plugins/GoogleAnalytics/GoogleAnalyticsPlugin.php @@ -64,7 +64,7 @@ class GoogleAnalyticsPlugin extends Plugin parent::__construct(); } - function onEndShowScripts($action) + function onEndShowScripts(Action $action) { $code = common_config('googleanalytics', 'code'); if (empty($code)) { diff --git a/plugins/InfiniteScroll/InfiniteScrollPlugin.php b/plugins/InfiniteScroll/InfiniteScrollPlugin.php index 716a90dedf..713e9ef61a 100644 --- a/plugins/InfiniteScroll/InfiniteScrollPlugin.php +++ b/plugins/InfiniteScroll/InfiniteScrollPlugin.php @@ -41,7 +41,7 @@ class InfiniteScrollPlugin extends Plugin parent::__construct(); } - function onEndShowScripts($action) + function onEndShowScripts(Action $action) { $action->inlineScript('var infinite_scroll_on_next_only = ' . ($this->on_next_only?'true':'false') . ';'); $action->inlineScript('var ajax_loader_url = "' . ($this->path('ajax-loader.gif')) . '";'); diff --git a/plugins/LinkPreview/LinkPreviewPlugin.php b/plugins/LinkPreview/LinkPreviewPlugin.php index 5edf66767d..5e04d4d154 100644 --- a/plugins/LinkPreview/LinkPreviewPlugin.php +++ b/plugins/LinkPreview/LinkPreviewPlugin.php @@ -48,7 +48,7 @@ class LinkPreviewPlugin extends Plugin * @param Action $action * @return boolean hook result */ - function onEndShowScripts($action) + function onEndShowScripts(Action $action) { $user = common_current_user(); if ($user && common_config('attachments', 'process_links')) { diff --git a/plugins/Mapstraction/MapstractionPlugin.php b/plugins/Mapstraction/MapstractionPlugin.php index c802fbfb91..7356607ce2 100644 --- a/plugins/Mapstraction/MapstractionPlugin.php +++ b/plugins/Mapstraction/MapstractionPlugin.php @@ -83,7 +83,7 @@ class MapstractionPlugin extends Plugin * * @return boolean event handler return */ - function onEndShowScripts($action) + function onEndShowScripts(Action $action) { $actionName = $action->trimmed('action'); diff --git a/plugins/Mapstraction/actions/map.php b/plugins/Mapstraction/actions/map.php index 4db127ec50..3fad900b5a 100644 --- a/plugins/Mapstraction/actions/map.php +++ b/plugins/Mapstraction/actions/map.php @@ -133,7 +133,7 @@ class MapAction extends Action return true; } - function noticeAsJson($notice) + function noticeAsJson(Notice $notice) { // FIXME: this code should be abstracted to a neutral third // party, like Notice::asJson(). I'm not sure of the ethics diff --git a/plugins/MobileProfile/MobileProfilePlugin.php b/plugins/MobileProfile/MobileProfilePlugin.php index c496eb0fcb..5d0fd2ddb9 100644 --- a/plugins/MobileProfile/MobileProfilePlugin.php +++ b/plugins/MobileProfile/MobileProfilePlugin.php @@ -332,7 +332,7 @@ class MobileProfilePlugin extends WAP20Plugin } } - function onEndShowScripts($action) + function onEndShowScripts(Action $action) { // @todo FIXME: "Show Navigation" / "Hide Navigation" needs i18n $action->inlineScript(' diff --git a/plugins/OpenExternalLinkTarget/OpenExternalLinkTargetPlugin.php b/plugins/OpenExternalLinkTarget/OpenExternalLinkTargetPlugin.php index 06c75f7a93..a597f82996 100644 --- a/plugins/OpenExternalLinkTarget/OpenExternalLinkTargetPlugin.php +++ b/plugins/OpenExternalLinkTarget/OpenExternalLinkTargetPlugin.php @@ -42,7 +42,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { */ class OpenExternalLinkTargetPlugin extends Plugin { - function onEndShowScripts($action) + function onEndShowScripts(Action $action) { $action->inlineScript('$(document).on("click", "a[rel~=external]:not([class~=attachment])", function () { window.open(this.href); return false; });'); diff --git a/plugins/PiwikAnalytics/PiwikAnalyticsPlugin.php b/plugins/PiwikAnalytics/PiwikAnalyticsPlugin.php index fa5894a8f5..59ef822cb2 100644 --- a/plugins/PiwikAnalytics/PiwikAnalyticsPlugin.php +++ b/plugins/PiwikAnalytics/PiwikAnalyticsPlugin.php @@ -76,7 +76,7 @@ class PiwikAnalyticsPlugin extends Plugin * * @return boolean ignored */ - function onEndShowScripts($action) + function onEndShowScripts(Action $action) { // Slight modification to the default code. // Loading the piwik.js file from a