From e7d3a006c82f47f1ba3aebfec4ab6333a4367a16 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Wed, 26 Dec 2018 21:58:07 +0100 Subject: [PATCH] global: Fix code violations --- bridges/AcrimedBridge.php | 1 - bridges/AllocineFRBridge.php | 1 - bridges/AnimeUltimeBridge.php | 1 - bridges/Arte7Bridge.php | 1 - bridges/BlaguesDeMerdeBridge.php | 1 - bridges/BundesbankBridge.php | 1 - bridges/DealabsBridge.php | 4 ---- bridges/DesoutterBridge.php | 1 - bridges/DevToBridge.php | 1 - bridges/ElloBridge.php | 1 - bridges/ExtremeDownloadBridge.php | 1 - bridges/FB2Bridge.php | 3 --- bridges/FacebookBridge.php | 1 - bridges/FlickrBridge.php | 1 - bridges/ForGifsBridge.php | 1 - bridges/GOGBridge.php | 1 - bridges/GitHubGistBridge.php | 1 - bridges/GooglePlusPostBridge.php | 1 - bridges/InstagramBridge.php | 1 - bridges/JustETFBridge.php | 1 - bridges/KATBridge.php | 1 + bridges/KernelBugTrackerBridge.php | 1 - bridges/LeBonCoinBridge.php | 2 -- bridges/ModelKarteiBridge.php | 2 -- bridges/OnVaSortirBridge.php | 2 ++ bridges/OneFortuneADayBridge.php | 2 -- bridges/OsmAndBlogBridge.php | 3 --- bridges/PixivBridge.php | 2 -- bridges/Rue89Bridge.php | 2 -- bridges/Shimmie2Bridge.php | 1 - bridges/SkimfeedBridge.php | 2 -- bridges/SoundcloudBridge.php | 1 + bridges/SupInfoBridge.php | 1 - bridges/ThingiverseBridge.php | 1 - bridges/UsbekEtRicaBridge.php | 1 - bridges/WhydBridge.php | 1 + bridges/WordPressPluginUpdateBridge.php | 1 - bridges/XenForoBridge.php | 1 - formats/AtomFormat.php | 1 - formats/HtmlFormat.php | 1 - formats/JsonFormat.php | 1 - formats/MrssFormat.php | 1 - formats/PlaintextFormat.php | 1 - lib/Authentication.php | 2 -- lib/BridgeAbstract.php | 1 - lib/BridgeCard.php | 1 - lib/BridgeInterface.php | 1 - lib/BridgeList.php | 1 - lib/CacheInterface.php | 1 - lib/Configuration.php | 1 - lib/FormatInterface.php | 1 - tests/BridgeImplementationTest.php | 1 - 52 files changed, 5 insertions(+), 62 deletions(-) diff --git a/bridges/AcrimedBridge.php b/bridges/AcrimedBridge.php index 8b40d1d5..7e0fb6b2 100644 --- a/bridges/AcrimedBridge.php +++ b/bridges/AcrimedBridge.php @@ -21,5 +21,4 @@ class AcrimedBridge extends FeedExpander { return $item; } - } diff --git a/bridges/AllocineFRBridge.php b/bridges/AllocineFRBridge.php index 431ae58f..50a41ec7 100644 --- a/bridges/AllocineFRBridge.php +++ b/bridges/AllocineFRBridge.php @@ -83,5 +83,4 @@ class AllocineFRBridge extends BridgeAbstract { } } } - } diff --git a/bridges/AnimeUltimeBridge.php b/bridges/AnimeUltimeBridge.php index 5c719b92..bc1dd7bc 100644 --- a/bridges/AnimeUltimeBridge.php +++ b/bridges/AnimeUltimeBridge.php @@ -137,5 +137,4 @@ class AnimeUltimeBridge extends BridgeAbstract { return parent::getName(); } - } diff --git a/bridges/Arte7Bridge.php b/bridges/Arte7Bridge.php index 12588c60..ff722113 100644 --- a/bridges/Arte7Bridge.php +++ b/bridges/Arte7Bridge.php @@ -119,5 +119,4 @@ class Arte7Bridge extends BridgeAbstract { $this->items[] = $item; } } - } diff --git a/bridges/BlaguesDeMerdeBridge.php b/bridges/BlaguesDeMerdeBridge.php index e4af8d59..cae8f4f5 100644 --- a/bridges/BlaguesDeMerdeBridge.php +++ b/bridges/BlaguesDeMerdeBridge.php @@ -43,5 +43,4 @@ class BlaguesDeMerdeBridge extends BridgeAbstract { } } - } diff --git a/bridges/BundesbankBridge.php b/bridges/BundesbankBridge.php index 59c07e0c..d21f22b6 100644 --- a/bridges/BundesbankBridge.php +++ b/bridges/BundesbankBridge.php @@ -83,5 +83,4 @@ class BundesbankBridge extends BridgeAbstract { } } - } diff --git a/bridges/DealabsBridge.php b/bridges/DealabsBridge.php index 525cb38d..873f5d01 100644 --- a/bridges/DealabsBridge.php +++ b/bridges/DealabsBridge.php @@ -1224,7 +1224,6 @@ class PepperBridgeAbstract extends BridgeAbstract { } } - /** * Get the Shipping costs from a Deal if it exists * @return string String of the deal shipping Cost @@ -1457,8 +1456,6 @@ class PepperBridgeAbstract extends BridgeAbstract { } } - - /** * This is some "localisation" function that returns the needed content using * the "$lang" class variable in the local class @@ -1472,5 +1469,4 @@ class PepperBridgeAbstract extends BridgeAbstract { return null; } } - } diff --git a/bridges/DesoutterBridge.php b/bridges/DesoutterBridge.php index 94059f63..14e26c26 100644 --- a/bridges/DesoutterBridge.php +++ b/bridges/DesoutterBridge.php @@ -236,5 +236,4 @@ class DesoutterBridge extends BridgeAbstract { echo $list; } - } diff --git a/bridges/DevToBridge.php b/bridges/DevToBridge.php index 2dfc0337..26552c69 100644 --- a/bridges/DevToBridge.php +++ b/bridges/DevToBridge.php @@ -101,5 +101,4 @@ EOD; return $html->find('[id="article-body"]', 0); } - } diff --git a/bridges/ElloBridge.php b/bridges/ElloBridge.php index b51fed77..22f5d309 100644 --- a/bridges/ElloBridge.php +++ b/bridges/ElloBridge.php @@ -143,5 +143,4 @@ class ElloBridge extends BridgeAbstract { return parent::getName(); } - } diff --git a/bridges/ExtremeDownloadBridge.php b/bridges/ExtremeDownloadBridge.php index eac27e36..3a4f60d6 100644 --- a/bridges/ExtremeDownloadBridge.php +++ b/bridges/ExtremeDownloadBridge.php @@ -100,5 +100,4 @@ class ExtremeDownloadBridge extends BridgeAbstract { return $return; } - } diff --git a/bridges/FB2Bridge.php b/bridges/FB2Bridge.php index 862d20b2..29df7554 100644 --- a/bridges/FB2Bridge.php +++ b/bridges/FB2Bridge.php @@ -198,7 +198,6 @@ EOD; } - //Builds the HTML from the encoded JS that Facebook provides. private function buildContent($pageContent){ // The html ends with: @@ -213,7 +212,6 @@ EOD; return str_get_html($htmlContent); } - //Builds the cookie from the page, as Facebook sometimes refuses to give //the page if no cookie is provided. private function getCookies($pageURL){ @@ -289,5 +287,4 @@ EOD; public function getURI(){ return 'http://facebook.com'; } - } diff --git a/bridges/FacebookBridge.php b/bridges/FacebookBridge.php index fcdb5706..63f8ddaf 100644 --- a/bridges/FacebookBridge.php +++ b/bridges/FacebookBridge.php @@ -687,7 +687,6 @@ EOD; } } } - #endregion (User) } diff --git a/bridges/FlickrBridge.php b/bridges/FlickrBridge.php index 6dd34318..cb9db722 100644 --- a/bridges/FlickrBridge.php +++ b/bridges/FlickrBridge.php @@ -182,5 +182,4 @@ class FlickrBridge extends BridgeAbstract { return $url; } - } diff --git a/bridges/ForGifsBridge.php b/bridges/ForGifsBridge.php index 9e76017c..ea599b9b 100644 --- a/bridges/ForGifsBridge.php +++ b/bridges/ForGifsBridge.php @@ -37,5 +37,4 @@ class ForGifsBridge extends FeedExpander { return $item; } - } diff --git a/bridges/GOGBridge.php b/bridges/GOGBridge.php index 79047c69..669332f0 100644 --- a/bridges/GOGBridge.php +++ b/bridges/GOGBridge.php @@ -62,5 +62,4 @@ class GOGBridge extends BridgeAbstract { return $content; } - } diff --git a/bridges/GitHubGistBridge.php b/bridges/GitHubGistBridge.php index 98e40800..f20acb59 100644 --- a/bridges/GitHubGistBridge.php +++ b/bridges/GitHubGistBridge.php @@ -160,5 +160,4 @@ EOD; return $content; } - } diff --git a/bridges/GooglePlusPostBridge.php b/bridges/GooglePlusPostBridge.php index cc3355e6..7911eaf4 100644 --- a/bridges/GooglePlusPostBridge.php +++ b/bridges/GooglePlusPostBridge.php @@ -205,5 +205,4 @@ class GooglePlusPostBridge extends BridgeAbstract{ return implode('', [$scheme, $user, $pass, $host, $port, $path, $query, $fragment]); } - } diff --git a/bridges/InstagramBridge.php b/bridges/InstagramBridge.php index 37b2de84..fed8d64c 100644 --- a/bridges/InstagramBridge.php +++ b/bridges/InstagramBridge.php @@ -168,5 +168,4 @@ class InstagramBridge extends BridgeAbstract { } return parent::getURI(); } - } diff --git a/bridges/JustETFBridge.php b/bridges/JustETFBridge.php index 32aa65e6..85318b8e 100644 --- a/bridges/JustETFBridge.php +++ b/bridges/JustETFBridge.php @@ -348,6 +348,5 @@ class JustETFBridge extends BridgeAbstract { return $element->plaintext; } - #endregion } diff --git a/bridges/KATBridge.php b/bridges/KATBridge.php index 55756bf8..7e312a18 100644 --- a/bridges/KATBridge.php +++ b/bridges/KATBridge.php @@ -53,6 +53,7 @@ class KATBridge extends BridgeAbstract { $guessedDate['tm_year'] + 1900); return $timestamp; } + $catBool = $this->getInput('cat_check'); if($catBool) { $catNum = $this->getInput('cat'); diff --git a/bridges/KernelBugTrackerBridge.php b/bridges/KernelBugTrackerBridge.php index 5fdb2a53..d617b80f 100644 --- a/bridges/KernelBugTrackerBridge.php +++ b/bridges/KernelBugTrackerBridge.php @@ -150,5 +150,4 @@ class KernelBugTrackerBridge extends BridgeAbstract { return $html; } - } diff --git a/bridges/LeBonCoinBridge.php b/bridges/LeBonCoinBridge.php index b2cffcf8..36196cb1 100644 --- a/bridges/LeBonCoinBridge.php +++ b/bridges/LeBonCoinBridge.php @@ -419,7 +419,6 @@ class LeBonCoinBridge extends BridgeAbstract { } } - private function buildRequestJson() { $requestJson = new StdClass(); @@ -534,5 +533,4 @@ class LeBonCoinBridge extends BridgeAbstract { return json_encode($requestJson); } - } diff --git a/bridges/ModelKarteiBridge.php b/bridges/ModelKarteiBridge.php index 9bd63345..6def6834 100644 --- a/bridges/ModelKarteiBridge.php +++ b/bridges/ModelKarteiBridge.php @@ -15,7 +15,6 @@ class ModelKarteiBridge extends BridgeAbstract { private $feedName = ''; - public function collectData() { $model_id = preg_replace('/[^0-9]/', '', $this->getInput('model_id')); if (empty($model_id)) @@ -94,7 +93,6 @@ class ModelKarteiBridge extends BridgeAbstract { } } - public function getName(){ if(!empty($this->feedName)) { return $this->feedName . ' - ' . self::NAME; diff --git a/bridges/OnVaSortirBridge.php b/bridges/OnVaSortirBridge.php index 2fcde708..aad44fb8 100644 --- a/bridges/OnVaSortirBridge.php +++ b/bridges/OnVaSortirBridge.php @@ -116,6 +116,7 @@ class OnVaSortirBridge extends FeedExpander { ) ) ); + protected function parseItem($item){ $item = parent::parseItem($item); $html = getSimpleHTMLDOMCached($item['uri']); @@ -123,6 +124,7 @@ class OnVaSortirBridge extends FeedExpander { $item['content'] = utf8_encode($text); return $item; } + public function collectData(){ $this->collectExpandableDatas('https://' . $this->getInput('city') . '.onvasortir.com/rss.php'); diff --git a/bridges/OneFortuneADayBridge.php b/bridges/OneFortuneADayBridge.php index 303b1480..ed0b5ec6 100644 --- a/bridges/OneFortuneADayBridge.php +++ b/bridges/OneFortuneADayBridge.php @@ -41,7 +41,6 @@ class OneFortuneADayBridge extends BridgeAbstract { const LIMIT_ITEMS = 7; const DAY_SECS = 86400; - public function collectData() { $time = gmmktime((int)$this->getInput('time'), 0, 0); if ($time > time()) @@ -62,7 +61,6 @@ class OneFortuneADayBridge extends BridgeAbstract { } } - private function getQuote($seed) { $quotes = explode('//', <<outertext = ''; diff --git a/bridges/PixivBridge.php b/bridges/PixivBridge.php index b1cba4e0..4af2da5a 100644 --- a/bridges/PixivBridge.php +++ b/bridges/PixivBridge.php @@ -15,7 +15,6 @@ class PixivBridge extends BridgeAbstract { ), )); - public function collectData(){ $html = getContents(static::URI . 'search.php?word=' . urlencode($this->getInput('tag'))) @@ -70,5 +69,4 @@ class PixivBridge extends BridgeAbstract { return 'cache/pixiv_img/' . $illustId . '.jpeg'; } - } diff --git a/bridges/Rue89Bridge.php b/bridges/Rue89Bridge.php index ca0e9b66..934ef991 100644 --- a/bridges/Rue89Bridge.php +++ b/bridges/Rue89Bridge.php @@ -6,7 +6,6 @@ class Rue89Bridge extends BridgeAbstract { const URI = 'https://www.nouvelobs.com/rue89/'; const DESCRIPTION = 'Returns the newest posts from Rue89'; - public function collectData() { $jsonArticles = getContents('https://appdata.nouvelobs.com/rue89/feed.json') @@ -46,5 +45,4 @@ class Rue89Bridge extends BridgeAbstract { return $item; } - } diff --git a/bridges/Shimmie2Bridge.php b/bridges/Shimmie2Bridge.php index bdbc504a..99235147 100644 --- a/bridges/Shimmie2Bridge.php +++ b/bridges/Shimmie2Bridge.php @@ -35,5 +35,4 @@ class Shimmie2Bridge extends DanbooruBridge { return $item; } - } diff --git a/bridges/SkimfeedBridge.php b/bridges/SkimfeedBridge.php index 0b22b110..9fdd4549 100644 --- a/bridges/SkimfeedBridge.php +++ b/bridges/SkimfeedBridge.php @@ -804,7 +804,6 @@ EOD; EOD; } - /** * Checks if the reported skimfeed version is compatible */ @@ -821,5 +820,4 @@ EOD; return false; } - } diff --git a/bridges/SoundcloudBridge.php b/bridges/SoundcloudBridge.php index 1cea46c7..91ac2b5c 100644 --- a/bridges/SoundcloudBridge.php +++ b/bridges/SoundcloudBridge.php @@ -55,6 +55,7 @@ class SoundCloudBridge extends BridgeAbstract { } } + public function getName(){ if(!is_null($this->getInput('u'))) { return self::NAME . ' - ' . $this->getInput('u'); diff --git a/bridges/SupInfoBridge.php b/bridges/SupInfoBridge.php index 697aadf7..f713b00c 100644 --- a/bridges/SupInfoBridge.php +++ b/bridges/SupInfoBridge.php @@ -57,5 +57,4 @@ class SupInfoBridge extends BridgeAbstract { return $item; } - } diff --git a/bridges/ThingiverseBridge.php b/bridges/ThingiverseBridge.php index 2e108816..4c41fb6b 100644 --- a/bridges/ThingiverseBridge.php +++ b/bridges/ThingiverseBridge.php @@ -163,5 +163,4 @@ class ThingiverseBridge extends BridgeAbstract { return parent::getURI(); } - } diff --git a/bridges/UsbekEtRicaBridge.php b/bridges/UsbekEtRicaBridge.php index 4d5ba169..3cecd5dc 100644 --- a/bridges/UsbekEtRicaBridge.php +++ b/bridges/UsbekEtRicaBridge.php @@ -106,5 +106,4 @@ class UsbekEtRicaBridge extends BridgeAbstract { private function replaceUriInHtmlElement($element){ return str_replace('href="/', 'href="' . $this->getURI() . '/', $element->innertext); } - } diff --git a/bridges/WhydBridge.php b/bridges/WhydBridge.php index d14c22a8..04d0b30e 100644 --- a/bridges/WhydBridge.php +++ b/bridges/WhydBridge.php @@ -55,6 +55,7 @@ class WhydBridge extends BridgeAbstract { $this->items[] = $item; } } + public function getName(){ return (!empty($this->userName) ? $this->userName . ' - ' : '') . 'Whyd Bridge'; } diff --git a/bridges/WordPressPluginUpdateBridge.php b/bridges/WordPressPluginUpdateBridge.php index 19ec02be..80b53eac 100644 --- a/bridges/WordPressPluginUpdateBridge.php +++ b/bridges/WordPressPluginUpdateBridge.php @@ -64,7 +64,6 @@ class WordPressPluginUpdateBridge extends BridgeAbstract { } - public function getName(){ if(!is_null($this->getInput('q'))) { return $this->getInput('q') . ' : ' . self::NAME; diff --git a/bridges/XenForoBridge.php b/bridges/XenForoBridge.php index ad4df84c..57d35868 100644 --- a/bridges/XenForoBridge.php +++ b/bridges/XenForoBridge.php @@ -458,5 +458,4 @@ class XenForoBridge extends BridgeAbstract { return date_format($df, 'U'); } - } diff --git a/formats/AtomFormat.php b/formats/AtomFormat.php index 044e433f..693b6ad0 100644 --- a/formats/AtomFormat.php +++ b/formats/AtomFormat.php @@ -5,7 +5,6 @@ * http://tools.ietf.org/html/rfc4287 */ class AtomFormat extends FormatAbstract{ - public function stringify(){ $https = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : ''; $httpHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ''; diff --git a/formats/HtmlFormat.php b/formats/HtmlFormat.php index 71f70d29..f5e9cb22 100644 --- a/formats/HtmlFormat.php +++ b/formats/HtmlFormat.php @@ -1,6 +1,5 @@ getExtraInfos(); $title = htmlspecialchars($extraInfos['name']); diff --git a/formats/JsonFormat.php b/formats/JsonFormat.php index a60601a0..ef8c9f70 100644 --- a/formats/JsonFormat.php +++ b/formats/JsonFormat.php @@ -4,7 +4,6 @@ * Builds a JSON string from $this->items and return it to browser. */ class JsonFormat extends FormatAbstract { - public function stringify(){ $items = $this->getItems(); $toReturn = json_encode($items, JSON_PRETTY_PRINT); diff --git a/formats/MrssFormat.php b/formats/MrssFormat.php index 9110e020..023750eb 100644 --- a/formats/MrssFormat.php +++ b/formats/MrssFormat.php @@ -4,7 +4,6 @@ * Documentation Source http://www.rssboard.org/media-rss */ class MrssFormat extends FormatAbstract { - public function stringify(){ $https = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : ''; $httpHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ''; diff --git a/formats/PlaintextFormat.php b/formats/PlaintextFormat.php index c9691d0f..2c2fb217 100644 --- a/formats/PlaintextFormat.php +++ b/formats/PlaintextFormat.php @@ -4,7 +4,6 @@ * Returns $this->items as raw php data. */ class PlaintextFormat extends FormatAbstract { - public function stringify(){ $items = $this->getItems(); $toReturn = print_r($items, true); diff --git a/lib/Authentication.php b/lib/Authentication.php index 99deaacb..ac8ea96a 100644 --- a/lib/Authentication.php +++ b/lib/Authentication.php @@ -31,7 +31,6 @@ * utilized for limiting access to authorized users only. */ class Authentication { - /** * Throw an exception when trying to create a new instance of this class. * Use {@see Authentication::showPromptIfNeeded()} instead! @@ -83,5 +82,4 @@ class Authentication { return false; } - } diff --git a/lib/BridgeAbstract.php b/lib/BridgeAbstract.php index a2b15802..13215a46 100644 --- a/lib/BridgeAbstract.php +++ b/lib/BridgeAbstract.php @@ -290,5 +290,4 @@ abstract class BridgeAbstract implements BridgeInterface { return null; } } - } diff --git a/lib/BridgeCard.php b/lib/BridgeCard.php index 9cfa9ce6..a3493b75 100644 --- a/lib/BridgeCard.php +++ b/lib/BridgeCard.php @@ -20,7 +20,6 @@ * @todo Return error if a caller creates an object of this class. */ final class BridgeCard { - /** * Build a HTML document string of buttons for each of the provided formats * diff --git a/lib/BridgeInterface.php b/lib/BridgeInterface.php index 803bb3cd..d0069180 100644 --- a/lib/BridgeInterface.php +++ b/lib/BridgeInterface.php @@ -53,7 +53,6 @@ * The default cache timeout for the bridge. */ interface BridgeInterface { - /** * Collects data from the site */ diff --git a/lib/BridgeList.php b/lib/BridgeList.php index 5ff13cf4..d79d72f3 100644 --- a/lib/BridgeList.php +++ b/lib/BridgeList.php @@ -20,7 +20,6 @@ * @todo Return error if a caller creates an object of this class. */ final class BridgeList { - /** * Get the document head * diff --git a/lib/CacheInterface.php b/lib/CacheInterface.php index bd2d5613..a74fc0dd 100644 --- a/lib/CacheInterface.php +++ b/lib/CacheInterface.php @@ -19,7 +19,6 @@ * @todo Return self more often (to allow call chaining) */ interface CacheInterface { - /** * Loads data from cache * diff --git a/lib/Configuration.php b/lib/Configuration.php index 4bf1a4a1..3ea98514 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -242,5 +242,4 @@ final class Configuration { return Configuration::$VERSION; } - } diff --git a/lib/FormatInterface.php b/lib/FormatInterface.php index d59a4ef9..68b0bd59 100644 --- a/lib/FormatInterface.php +++ b/lib/FormatInterface.php @@ -19,7 +19,6 @@ * @todo Return self more often (to allow call chaining) */ interface FormatInterface { - /** * Generate a string representation of the current data * diff --git a/tests/BridgeImplementationTest.php b/tests/BridgeImplementationTest.php index 690a6189..ef4fe894 100644 --- a/tests/BridgeImplementationTest.php +++ b/tests/BridgeImplementationTest.php @@ -18,7 +18,6 @@ require_once __DIR__ . '/../lib/rssbridge.php'; * CACHE_TIMEOUT and PARAMETERS are optional */ final class BridgeImplementationTest extends TestCase { - private function CheckBridgePublicFunctions($bridgeName){ $parent_methods = array();