1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-23 08:33:24 +02:00

[bridges] use constants instead of variable members

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
Pierre Mazière
2016-08-30 11:23:55 +02:00
parent 556b8a2452
commit 9a0da733ef
129 changed files with 834 additions and 834 deletions

View File

@@ -1,11 +1,11 @@
<?php
class KununuBridge extends HttpCachingBridgeAbstract {
public $maintainer = "logmanoriginal";
public $name = "Kununu Bridge";
public $uri = "https://www.kununu.com/";
public $description = "Returns the latest reviews for a company and site of your choice.";
const MAINTAINER = "logmanoriginal";
const NAME = "Kununu Bridge";
const URI = "https://www.kununu.com/";
const DESCRIPTION = "Returns the latest reviews for a company and site of your choice.";
public $parameters = array(
const PARAMETERS = array(
'global' => array(
'site'=>array(
'name'=>'Site',
@@ -55,12 +55,12 @@ class KununuBridge extends HttpCachingBridgeAbstract {
break;
}
return $this->uri.$site.'/'.$company.'/'.$section;
return self::URI.$site.'/'.$company.'/'.$section;
}
function getName(){
$company = $this->encode_umlauts(strtolower(str_replace(' ', '-', trim($this->getInput('company')))));
return ($this->companyName?:$company).' - '.$this->name;
return ($this->companyName?:$company).' - '.self::NAME;
}
public function collectData(){
@@ -109,7 +109,7 @@ class KununuBridge extends HttpCachingBridgeAbstract {
* Fixes relative URLs in the given text
*/
private function fix_url($text){
return preg_replace('/href=(\'|\")\//i', 'href="'.$this->uri, $text);
return preg_replace('/href=(\'|\")\//i', 'href="'.self::URI, $text);
}
/**
@@ -184,7 +184,7 @@ class KununuBridge extends HttpCachingBridgeAbstract {
if($anchor === false)
$this->returnServerError('Cannot find article URI!');
return $this->uri . $anchor->href;
return self::URI . $anchor->href;
}
/**