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