diff --git a/bridges/AlbionOnlineBridge.php b/bridges/AlbionOnlineBridge.php
index 8a7a61b7..0a93901e 100644
--- a/bridges/AlbionOnlineBridge.php
+++ b/bridges/AlbionOnlineBridge.php
@@ -10,13 +10,7 @@ class AlbionOnlineBridge extends BridgeAbstract {
const PARAMETERS = array( array(
'postcount' => array(
'name' => 'Limit',
- 'type' => 'list',
- 'values' => array(
- '2' => 2,
- '5' => 5,
- '10' => 10,
- '15' => 15,
- ),
+ 'type' => 'number',
'title' => 'Maximum number of items to return',
'defaultValue' => 5,
),
diff --git a/bridges/CeskaTelevizeBridge.php b/bridges/CeskaTelevizeBridge.php
index ead807b5..ea3a4bf2 100755
--- a/bridges/CeskaTelevizeBridge.php
+++ b/bridges/CeskaTelevizeBridge.php
@@ -74,8 +74,8 @@ class CeskaTelevizeBridge extends BridgeAbstract {
}
}
- public function getUri() {
- return isset($this->feedUri) ? $this->feedUri : parent::getUri();
+ public function getURI() {
+ return isset($this->feedUri) ? $this->feedUri : parent::getURI();
}
public function getName() {
diff --git a/bridges/DiarioDeNoticiasBridge.php b/bridges/DiarioDeNoticiasBridge.php
index 0aaac6f4..887eb117 100644
--- a/bridges/DiarioDeNoticiasBridge.php
+++ b/bridges/DiarioDeNoticiasBridge.php
@@ -42,6 +42,7 @@ class DiarioDeNoticiasBridge extends BridgeAbstract {
}
return $name;
}
+
public function getURI() {
switch($this->queriedContext) {
case 'Tag':
diff --git a/bridges/DribbbleBridge.php b/bridges/DribbbleBridge.php
index f66608f4..01cfb21a 100644
--- a/bridges/DribbbleBridge.php
+++ b/bridges/DribbbleBridge.php
@@ -94,6 +94,6 @@ favicon-63b2904a073c89b52b19aa08cebc16a154bcf83fee8ecc6439968b1e6db569c7.ico';
}
private function getFullSizeImagePath($preview_path){
- return explode("?compress=1", $preview_path)[0];
+ return explode('?compress=1', $preview_path)[0];
}
}
diff --git a/bridges/EpicgamesBridge.php b/bridges/EpicgamesBridge.php
index 756efb3b..e6ba5421 100644
--- a/bridges/EpicgamesBridge.php
+++ b/bridges/EpicgamesBridge.php
@@ -10,14 +10,7 @@ class EpicgamesBridge extends BridgeAbstract {
const PARAMETERS = array( array(
'postcount' => array(
'name' => 'Limit',
- 'type' => 'list',
- 'values' => array(
- '5' => 5,
- '10' => 10,
- '15' => 15,
- '20' => 20,
- '25' => 25,
- ),
+ 'type' => 'number',
'title' => 'Maximum number of items to return',
'defaultValue' => 10,
),
diff --git a/bridges/FM4Bridge.php b/bridges/FM4Bridge.php
index 6f59e80f..e129c5c8 100644
--- a/bridges/FM4Bridge.php
+++ b/bridges/FM4Bridge.php
@@ -28,9 +28,9 @@ class FM4Bridge extends BridgeAbstract
)
);
- public function getPageData($tag, $page) {
+ private function getPageData($tag, $page) {
if($tag)
- $uri = self::URI . "/tags/" . $tag;
+ $uri = self::URI . '/tags/' . $tag;
else
$uri = self::URI;
@@ -47,7 +47,7 @@ class FM4Bridge extends BridgeAbstract
$item['uri'] = $article->find('a', 0)->href;
$item['title'] = $article->find('h2', 0)->plaintext;
$item['author'] = $article->find('p[class*=keyword]', 0)->plaintext;
- $item["timestamp"] = strtotime($article->find('p[class*=time]', 0)->plaintext);
+ $item['timestamp'] = strtotime($article->find('p[class*=time]', 0)->plaintext);
if ($this->getInput('loadcontent')) {
$item['content'] = getSimpleHTMLDOM($item['uri'])->find('div[class=storyText]', 0)->innertext
@@ -58,9 +58,10 @@ class FM4Bridge extends BridgeAbstract
}
return $page_items;
}
+
public function collectData() {
for ($cur_page = 1; $cur_page <= $this->getInput('pages'); $cur_page++) {
- $this->items = array_merge($this->items,$this->getPageData($this->getInput('tag'), $cur_page));
+ $this->items = array_merge($this->items, $this->getPageData($this->getInput('tag'), $cur_page));
}
}
}
diff --git a/bridges/FicbookBridge.php b/bridges/FicbookBridge.php
index b79ad257..7c897017 100644
--- a/bridges/FicbookBridge.php
+++ b/bridges/FicbookBridge.php
@@ -82,7 +82,7 @@ class FicbookBridge extends BridgeAbstract {
$html = defaultLinkTo($html, self::URI);
- if ($this->queriedContext == 'Fiction Updates' or $this->queriedContext == 'Fiction Comments' ) {
+ if ($this->queriedContext == 'Fiction Updates' or $this->queriedContext == 'Fiction Comments') {
$this->titleName = $html->find('.fanfic-main-info > h1', 0)->innertext;
}
diff --git a/bridges/MarktplaatsBridge.php b/bridges/MarktplaatsBridge.php
index d8fce6c4..ada65920 100644
--- a/bridges/MarktplaatsBridge.php
+++ b/bridges/MarktplaatsBridge.php
@@ -103,8 +103,8 @@ class MarktplaatsBridge extends BridgeAbstract {
$item['content'] .= "
\n
\n
\n" . json_encode($listing);
}
}
- $item['content'] .= "
\n
\nPrice: " . $listing->priceInfo->priceCents/100;
- $item['content'] .= " (" . $listing->priceInfo->priceType .")";
+ $item['content'] .= "
\n
\nPrice: " . $listing->priceInfo->priceCents / 100;
+ $item['content'] .= ' (' . $listing->priceInfo->priceType . ')';
if(!empty($listing->location->cityName)) {
$item['content'] .= "
\n" . $listing->location->cityName;
}
@@ -117,11 +117,11 @@ class MarktplaatsBridge extends BridgeAbstract {
}
}
}
-
+
public function getName(){
- if(!is_null($this->getInput('q'))) {
- return $this->getInput('q') . ' - Marktplaats';
- }
- return parent::getName();
- }
+ if(!is_null($this->getInput('q'))) {
+ return $this->getInput('q') . ' - Marktplaats';
+ }
+ return parent::getName();
+ }
}
diff --git a/bridges/MondeDiploBridge.php b/bridges/MondeDiploBridge.php
index c5ed6169..cff84967 100644
--- a/bridges/MondeDiploBridge.php
+++ b/bridges/MondeDiploBridge.php
@@ -7,9 +7,9 @@ class MondeDiploBridge extends BridgeAbstract {
const CACHE_TIMEOUT = 21600; //6h
const DESCRIPTION = 'Returns most recent results from MondeDiplo.';
- private function cleanText($text) {
- return trim(str_replace([' ', ' '], ' ', $text));
- }
+ private function cleanText($text) {
+ return trim(str_replace(array(' ', ' '), ' ', $text));
+ }
public function collectData(){
$html = getSimpleHTMLDOM(self::URI)
@@ -22,7 +22,7 @@ class MondeDiploBridge extends BridgeAbstract {
$item = array();
$item['uri'] = self::URI . $element->href;
$item['title'] = $this->cleanText($title) . ' - ' . $this->cleanText($datesAuteurs);
- $item['content'] = $this->cleanText(str_replace([$title, $datesAuteurs], '', $element->plaintext));
+ $item['content'] = $this->cleanText(str_replace(array($title, $datesAuteurs), '', $element->plaintext));
$this->items[] = $item;
}
diff --git a/bridges/NasaApodBridge.php b/bridges/NasaApodBridge.php
index cf633415..6e2674f0 100644
--- a/bridges/NasaApodBridge.php
+++ b/bridges/NasaApodBridge.php
@@ -24,7 +24,7 @@ class NasaApodBridge extends BridgeAbstract {
$picture_html_string = $picture_html->innertext;
//Extract image and explanation
- $image_wrapper = $picture_html->find('a',1);
+ $image_wrapper = $picture_html->find('a', 1);
$image_path = $image_wrapper->href;
$img_placeholder = $image_wrapper->find('img', 0);
$img_alt = $img_placeholder->alt;
diff --git a/bridges/NordbayernBridge.php b/bridges/NordbayernBridge.php
index ecc93c9d..37fa3d5e 100644
--- a/bridges/NordbayernBridge.php
+++ b/bridges/NordbayernBridge.php
@@ -48,11 +48,16 @@ class NordbayernBridge extends BridgeAbstract {
));
private function getImageUrlFromScript($script) {
- preg_match("#src=\\\\'(https:[-:\\.\\\\/a-zA-Z0-9%_]*\\.(jpg|JPG))#", $script->innertext, $matches, PREG_OFFSET_CAPTURE);
+ preg_match(
+ "#src=\\\\'(https:[-:\\.\\\\/a-zA-Z0-9%_]*\\.(jpg|JPG))#",
+ $script->innertext,
+ $matches,
+ PREG_OFFSET_CAPTURE
+ );
if(isset($matches[1][0])) {
return stripcslashes($matches[1][0]) . '?w=800';
}
- return null;
+ return null;
}
private function handleArticle($link) {
diff --git a/bridges/OtrkeyFinderBridge.php b/bridges/OtrkeyFinderBridge.php
index 887ccd1b..32ce5c4f 100644
--- a/bridges/OtrkeyFinderBridge.php
+++ b/bridges/OtrkeyFinderBridge.php
@@ -11,13 +11,11 @@ class OtrkeyFinderBridge extends BridgeAbstract {
'searchterm' => array(
'name' => 'Search term',
'exampleValue' => 'Terminator',
- 'defaultValue' => '',
'title' => 'The search term is case-insensitive',
),
'station' => array(
'name' => 'Station name',
'exampleValue' => 'ARD',
- 'defaultValue' => '',
),
'type' => array(
'name' => 'Media type',
@@ -143,7 +141,11 @@ class OtrkeyFinderBridge extends BridgeAbstract {
$item['content'] = $content;
if (preg_match(self::TIME_REGEX, $file, $matches) === 1) {
- $item['timestamp'] = DateTime::createFromFormat('y.m.d_H-i', $matches[0], new DateTimeZone('Europe/Berlin'))->getTimestamp();
+ $item['timestamp'] = DateTime::createFromFormat(
+ 'y.m.d_H-i',
+ $matches[0],
+ new DateTimeZone('Europe/Berlin')
+ )->getTimestamp();
}
return $item;
diff --git a/bridges/ReleasesSwitchBridge.php b/bridges/ReleasesSwitchBridge.php
index 3814f8ec..89ca76d5 100644
--- a/bridges/ReleasesSwitchBridge.php
+++ b/bridges/ReleasesSwitchBridge.php
@@ -1,7 +1,7 @@
has_error)
- {
+ if($json->has_error) {
returnServerError($json->message);
}
$list = $json->list;
- foreach($list as $img)
- {
+ foreach($list as $img) {
$item = array();
$item['uri'] = self::URI . substr($img->photo->url, 1);
$item['title'] = $img->photo->subject;