bridges: Return parent::getName by default

This commit is contained in:
logmanoriginal 2017-02-14 22:20:55 +01:00
parent d93d491d8e
commit c4169f1579
29 changed files with 145 additions and 57 deletions

View file

@ -44,11 +44,11 @@ class AllocineFRBridge extends BridgeAbstract {
public function getName(){
if(!is_null($this->getInput('category'))){
return self::NAME . ' : '
.array_search(
$this->getInput('category'),
self::PARAMETERS[$this->queriedContext]['category']['values']
);
return self::NAME . ' : '
.array_search(
$this->getInput('category'),
self::PARAMETERS[$this->queriedContext]['category']['values']
);
}
return parent::getName();

View file

@ -51,8 +51,11 @@ class AmazonBridge extends BridgeAbstract {
));
public function getName(){
if(!is_null($this->getInput('tld')) && !is_null($this->getInput('q'))){
return 'Amazon.'.$this->getInput('tld').': '.$this->getInput('q');
}
return 'Amazon.'.$this->getInput('tld').': '.$this->getInput('q');
return parent::getName();
}
public function collectData() {

View file

@ -57,7 +57,11 @@ class AskfmBridge extends BridgeAbstract {
}
public function getName(){
return self::NAME . ' : ' . $this->getInput('u');
if(!is_null($this->getInput('u'))){
return self::NAME . ' : ' . $this->getInput('u');
}
return parent::getName();
}
public function getURI(){

View file

@ -50,6 +50,10 @@ class BandcampBridge extends BridgeAbstract {
}
public function getName(){
return $this->getInput('tag') . ' - Bandcamp Tag';
if(!is_null($this->getInput('tag'))){
return $this->getInput('tag') . ' - Bandcamp Tag';
}
return parent::getName();
}
}

View file

@ -32,6 +32,10 @@ class BooruprojectBridge extends GelbooruBridge {
}
public function getName(){
return static::NAME . ' ' . $this->getInput('i');
if(!is_null($this->getInput('i'))){
return static::NAME . ' ' . $this->getInput('i');
}
return parent::getName();
}
}

View file

@ -83,7 +83,11 @@ topic found in some section URLs, else all topics are selected.';
}
public function getName(){
$topic = $this->getInput('topic');
return 'CNET News Bridge' . (empty($topic) ? '' : ' - ' . $topic);
if(!is_null($this->getInput('topic'))){
$topic = $this->getInput('topic');
return 'CNET News Bridge' . (empty($topic) ? '' : ' - ' . $topic);
}
return parent::getName();
}
}

View file

@ -50,7 +50,11 @@ class CpasbienBridge extends BridgeAbstract {
}
public function getName(){
return $this->getInput('q') . ' : ' . self::NAME;
if(!is_null($this->getInput('q'))){
return $this->getInput('q') . ' : ' . self::NAME;
}
return parent::getName();
}
private function getCachedDate($url){

View file

@ -257,6 +257,11 @@ EOD;
}
public function getName(){
return isset($this->extraInfos['name']) ? $this->extraInfos['name'] : $this->authorName . ' - Facebook Bridge';
if(!empty($this->authorName)){
return isset($this->extraInfos['name']) ? $this->extraInfos['name'] : $this->authorName
. ' - Facebook Bridge';
}
return parent::getName();
}
}

View file

@ -47,6 +47,7 @@ class GithubIssueBridge extends BridgeAbstract {
case 'Issue comments':
$name = static::NAME . ' ' . $name . ' #' . $this->getInput('i');
break;
default: return parent::getName();
}
return $name;
}

View file

@ -46,6 +46,10 @@ class GoComicsBridge extends BridgeAbstract {
}
public function getName(){
return $this->getInput('comicname') . ' - GoComics';
if(!is_null($this->getInput('comicname'))){
return $this->getInput('comicname') . ' - GoComics';
}
return parent::getName();
}
}

View file

@ -55,6 +55,10 @@ class GoogleSearchBridge extends BridgeAbstract {
}
public function getName(){
return $this->getInput('q') . ' - Google search';
if(!is_null($this->getInput('q'))){
return $this->getInput('q') . ' - Google search';
}
return parent::getName();
}
}

View file

@ -70,10 +70,14 @@ class HDWallpapersBridge extends BridgeAbstract {
}
public function getName(){
return 'HDWallpapers - '
. str_replace(['__', '_'], [' & ', ' '], $this->getInput('c'))
. ' ['
. $this->getInput('r')
. ']';
if(!is_null($this->getInput('c')) && !is_null($this->getInput('r'))){
return 'HDWallpapers - '
. str_replace(['__', '_'], [' & ', ' '], $this->getInput('c'))
. ' ['
. $this->getInput('r')
. ']';
}
return parent::getName();
}
}

View file

@ -35,7 +35,11 @@ class IdenticaBridge extends BridgeAbstract {
}
public function getName(){
return $this->getInput('u') . ' - Identica Bridge';
if(!is_null($this->getInput('u'))){
return $this->getInput('u') . ' - Identica Bridge';
}
return parent::getName();
}
public function getURI(){

View file

@ -53,7 +53,11 @@ class InstagramBridge extends BridgeAbstract {
}
public function getName(){
return $this->getInput('u') . ' - Instagram Bridge';
if(!is_null($this->getInput('u'))){
return $this->getInput('u') . ' - Instagram Bridge';
}
return parent::getName();
}
public function getURI(){

View file

@ -70,7 +70,7 @@ class KununuBridge extends BridgeAbstract {
return ($this->companyName ?: $company) . ' - ' . self::NAME;
}
return paren::getName();
return parent::getName();
}
public function collectData(){

View file

@ -16,7 +16,11 @@ class MixCloudBridge extends BridgeAbstract {
));
public function getName(){
return 'MixCloud - ' . $this->getInput('u');
if(!is_null($this->getInput('u'))){
return 'MixCloud - ' . $this->getInput('u');
}
return parent::getName();
}
public function collectData(){

View file

@ -56,6 +56,10 @@ class NovelUpdatesBridge extends BridgeAbstract {
}
public function getName(){
if(!empty($this->seriesTitle)){
return $this->seriesTitle . ' - ' . static::NAME;
}
return parent::getName();
}
}

View file

@ -84,15 +84,19 @@ class ParuVenduImmoBridge extends BridgeAbstract {
}
public function getName(){
$request = '';
$minarea = $this->getInput('minarea');
if(!empty($minarea)){
$request .= ' ' . $minarea . ' m2';
if(!is_null($this->getInput('minarea'))){
$request = '';
$minarea = $this->getInput('minarea');
if(!empty($minarea)){
$request .= ' ' . $minarea . ' m2';
}
$location = $this->getInput('lo');
if(!empty($location)){
$request .= ' In: ' . $location;
}
return 'Paru Vendu Immobilier' . $request;
}
$location = $this->getInput('lo');
if(!empty($location)){
$request .= ' In: ' . $location;
}
return 'Paru Vendu Immobilier' . $request;
return parent::getName();
}
}

View file

@ -82,12 +82,16 @@ class PickyWallpapersBridge extends BridgeAbstract {
}
public function getName(){
$subcategory = $this->getInput('s');
return 'PickyWallpapers - '
. $this->getInput('c')
. ($subcategory ? ' > ' . $subcategory : '')
. ' ['
. $this->getInput('r')
. ']';
if(!is_null($this->getInput('s'))){
$subcategory = $this->getInput('s');
return 'PickyWallpapers - '
. $this->getInput('c')
. ($subcategory ? ' > ' . $subcategory : '')
. ' ['
. $this->getInput('r')
. ']';
}
return parent::getName();
}
}

View file

@ -53,6 +53,10 @@ class RTBFBridge extends BridgeAbstract {
}
public function getName(){
return $this->getInput('c') .' - RTBF Bridge';
if(!is_null($this->getInput('c'))){
return $this->getInput('c') .' - RTBF Bridge';
}
return parent::getName();
}
}

View file

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

View file

@ -61,6 +61,10 @@ class SuperbWallpapersBridge extends BridgeAbstract {
}
public function getName(){
return self::NAME . '- ' . $this->getInput('c') . ' [' . $this->getInput('r') . ']';
if(!is_null($this->getInput('c')) && !is_null($this->getInput('r'))){
return self::NAME . '- ' . $this->getInput('c') . ' [' . $this->getInput('r') . ']';
}
return parent::getName();
}
}

View file

@ -40,6 +40,10 @@ class TagBoardBridge extends BridgeAbstract {
}
public function getName(){
return 'tagboard - ' . $this->getInput('u');
if(!is_null($this->getInput('u'))){
return 'tagboard - ' . $this->getInput('u');
}
return parent::getName();
}
}

View file

@ -81,7 +81,11 @@ class Torrent9Bridge extends BridgeAbstract {
public function getName(){
return $this->getInput('q') . ' : ' . self::NAME;
if(!is_null($this->getInput('q'))){
return $this->getInput('q') . ' : ' . self::NAME;
}
return parent::getName();
}
private function getCachedDate($url){

View file

@ -46,6 +46,7 @@ class TwitterBridge extends BridgeAbstract {
$specific = '@';
$param = 'u';
break;
default: return parent::getName();
}
return 'Twitter ' . $specific . $this->getInput($param);
}

View file

@ -92,12 +92,16 @@ class WallpaperStopBridge extends BridgeAbstract {
}
public function getName(){
$subcategory = $this->getInput('s');
return 'WallpaperStop - '
. $this->getInput('c')
. (!empty($subcategory) ? ' > ' . $subcategory : '')
. ' ['
. $this->getInput('r')
. ']';
if(!is_null($this->getInput('s')) && !is_null($this->getInput('c')) && !is_null($this->getInput('r'))){
$subcategory = $this->getInput('s');
return 'WallpaperStop - '
. $this->getInput('c')
. (!empty($subcategory) ? ' > ' . $subcategory : '')
. ' ['
. $this->getInput('r')
. ']';
}
return parent::getName();
}
}

View file

@ -56,9 +56,7 @@ class WikipediaBridge extends BridgeAbstract {
case 'dyk':
$subject = WIKIPEDIA_SUBJECT_DYK;
break;
default:
$subject = WIKIPEDIA_SUBJECT_TFA;
break;
default: return parent::getName();
}
switch($subject){

View file

@ -38,7 +38,7 @@ class WorldOfTanksBridge extends BridgeAbstract {
}
public function getName(){
return $this->title ?: self::NAME;
return $this->title ?: parent::getName();
}
public function collectData(){

View file

@ -194,6 +194,6 @@ abstract class FeedExpander extends BridgeAbstract {
}
public function getName(){
return $this->name;
return $this->name ?: parent::getName();
}
}