global: Fix code violations

This commit is contained in:
logmanoriginal 2018-12-26 21:58:07 +01:00
parent ce65f51d91
commit e7d3a006c8
52 changed files with 5 additions and 62 deletions

View File

@ -21,5 +21,4 @@ class AcrimedBridge extends FeedExpander {
return $item;
}
}

View File

@ -83,5 +83,4 @@ class AllocineFRBridge extends BridgeAbstract {
}
}
}
}

View File

@ -137,5 +137,4 @@ class AnimeUltimeBridge extends BridgeAbstract {
return parent::getName();
}
}

View File

@ -119,5 +119,4 @@ class Arte7Bridge extends BridgeAbstract {
$this->items[] = $item;
}
}
}

View File

@ -43,5 +43,4 @@ class BlaguesDeMerdeBridge extends BridgeAbstract {
}
}
}

View File

@ -83,5 +83,4 @@ class BundesbankBridge extends BridgeAbstract {
}
}
}

View File

@ -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;
}
}
}

View File

@ -236,5 +236,4 @@ class DesoutterBridge extends BridgeAbstract {
echo $list;
}
}

View File

@ -101,5 +101,4 @@ EOD;
return $html->find('[id="article-body"]', 0);
}
}

View File

@ -143,5 +143,4 @@ class ElloBridge extends BridgeAbstract {
return parent::getName();
}
}

View File

@ -100,5 +100,4 @@ class ExtremeDownloadBridge extends BridgeAbstract {
return $return;
}
}

View File

@ -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';
}
}

View File

@ -687,7 +687,6 @@ EOD;
}
}
}
#endregion (User)
}

View File

@ -182,5 +182,4 @@ class FlickrBridge extends BridgeAbstract {
return $url;
}
}

View File

@ -37,5 +37,4 @@ class ForGifsBridge extends FeedExpander {
return $item;
}
}

View File

@ -62,5 +62,4 @@ class GOGBridge extends BridgeAbstract {
return $content;
}
}

View File

@ -160,5 +160,4 @@ EOD;
return $content;
}
}

View File

@ -205,5 +205,4 @@ class GooglePlusPostBridge extends BridgeAbstract{
return implode('', [$scheme, $user, $pass, $host, $port, $path, $query, $fragment]);
}
}

View File

@ -168,5 +168,4 @@ class InstagramBridge extends BridgeAbstract {
}
return parent::getURI();
}
}

View File

@ -348,6 +348,5 @@ class JustETFBridge extends BridgeAbstract {
return $element->plaintext;
}
#endregion
}

View File

@ -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');

View File

@ -150,5 +150,4 @@ class KernelBugTrackerBridge extends BridgeAbstract {
return $html;
}
}

View File

@ -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);
}
}

View File

@ -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;

View File

@ -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');

View File

@ -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('//', <<<QUOTES
People are naturally attracted to you.

View File

@ -5,7 +5,6 @@ class OsmAndBlogBridge extends BridgeAbstract {
const DESCRIPTION = 'Get the latest news from OsmAnd.net';
const MAINTAINER = 'fulmeek';
public function collectData() {
$html = getSimpleHTMLDOM(self::URI . 'blog')
or returnServerError('Could not load content');
@ -44,14 +43,12 @@ class OsmAndBlogBridge extends BridgeAbstract {
}
}
private function filterURL($url) {
if (strpos($url, '://') === false)
return self::URI . ltrim($url, '/');
return $url;
}
private function cleanupContent($content, ...$removeItems) {
foreach ($removeItems as $obj) {
if ($obj) $obj->outertext = '';

View File

@ -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';
}
}

View File

@ -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;
}
}

View File

@ -35,5 +35,4 @@ class Shimmie2Bridge extends DanbooruBridge {
return $item;
}
}

View File

@ -804,7 +804,6 @@ EOD;
EOD;
}
/**
* Checks if the reported skimfeed version is compatible
*/
@ -821,5 +820,4 @@ EOD;
return false;
}
}

View File

@ -55,6 +55,7 @@ class SoundCloudBridge extends BridgeAbstract {
}
}
public function getName(){
if(!is_null($this->getInput('u'))) {
return self::NAME . ' - ' . $this->getInput('u');

View File

@ -57,5 +57,4 @@ class SupInfoBridge extends BridgeAbstract {
return $item;
}
}

View File

@ -163,5 +163,4 @@ class ThingiverseBridge extends BridgeAbstract {
return parent::getURI();
}
}

View File

@ -106,5 +106,4 @@ class UsbekEtRicaBridge extends BridgeAbstract {
private function replaceUriInHtmlElement($element){
return str_replace('href="/', 'href="' . $this->getURI() . '/', $element->innertext);
}
}

View File

@ -55,6 +55,7 @@ class WhydBridge extends BridgeAbstract {
$this->items[] = $item;
}
}
public function getName(){
return (!empty($this->userName) ? $this->userName . ' - ' : '') . 'Whyd Bridge';
}

View File

@ -64,7 +64,6 @@ class WordPressPluginUpdateBridge extends BridgeAbstract {
}
public function getName(){
if(!is_null($this->getInput('q'))) {
return $this->getInput('q') . ' : ' . self::NAME;

View File

@ -458,5 +458,4 @@ class XenForoBridge extends BridgeAbstract {
return date_format($df, 'U');
}
}

View File

@ -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'] : '';

View File

@ -1,6 +1,5 @@
<?php
class HtmlFormat extends FormatAbstract {
public function stringify(){
$extraInfos = $this->getExtraInfos();
$title = htmlspecialchars($extraInfos['name']);

View File

@ -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);

View File

@ -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'] : '';

View File

@ -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);

View File

@ -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;
}
}

View File

@ -290,5 +290,4 @@ abstract class BridgeAbstract implements BridgeInterface {
return null;
}
}
}

View File

@ -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
*

View File

@ -53,7 +53,6 @@
* The default cache timeout for the bridge.
*/
interface BridgeInterface {
/**
* Collects data from the site
*/

View File

@ -20,7 +20,6 @@
* @todo Return error if a caller creates an object of this class.
*/
final class BridgeList {
/**
* Get the document head
*

View File

@ -19,7 +19,6 @@
* @todo Return self more often (to allow call chaining)
*/
interface CacheInterface {
/**
* Loads data from cache
*

View File

@ -242,5 +242,4 @@ final class Configuration {
return Configuration::$VERSION;
}
}

View File

@ -19,7 +19,6 @@
* @todo Return self more often (to allow call chaining)
*/
interface FormatInterface {
/**
* Generate a string representation of the current data
*

View File

@ -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();