From 21ce7d9ec02b0bf7c6e0ac7c28bc7c1bb0a841c5 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 26 Apr 2017 20:57:36 +0300 Subject: update phpmd ruleset to use (subset) of cleancode fix various minor issues reported by static analysis remove redundant php closing tag from several more files --- plugins/cache_starred_images/init.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'plugins/cache_starred_images') diff --git a/plugins/cache_starred_images/init.php b/plugins/cache_starred_images/init.php index de627fc77..6c9e67b17 100644 --- a/plugins/cache_starred_images/init.php +++ b/plugins/cache_starred_images/init.php @@ -11,10 +11,16 @@ class Cache_Starred_Images extends Plugin implements IHandler { true); } + /** + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ function csrf_ignore($method) { return false; } + /** + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ function before($method) { return true; } @@ -88,6 +94,9 @@ class Cache_Starred_Images extends Plugin implements IHandler { } } + /** + * @SuppressWarnings(PHPMD.UnusedLocalVariable) + */ function hook_house_keeping() { $files = glob($this->cache_dir . "/*.{png,mp4}", GLOB_BRACE); @@ -112,6 +121,9 @@ class Cache_Starred_Images extends Plugin implements IHandler { } } + /** + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ function hook_sanitize($doc, $site_url, $allowed_elements, $disallowed_attributes, $article_id) { $xpath = new DOMXpath($doc); @@ -162,6 +174,9 @@ class Cache_Starred_Images extends Plugin implements IHandler { } } + /** + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ function cache_article_images($content, $site_url, $owner_uid, $article_id) { libxml_use_internal_errors(true); @@ -211,4 +226,3 @@ class Cache_Starred_Images extends Plugin implements IHandler { return 2; } } -?> -- cgit v1.2.3