[NineGagBridge] Remove type hinting
Type hinting for strings doesn't work prior to PHP 7, see http://php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration References #837
This commit is contained in:
parent
c044694b21
commit
ae58b1566e
1 changed files with 8 additions and 8 deletions
|
@ -187,7 +187,7 @@ class NineGagBridge extends BridgeAbstract {
|
||||||
return $this->p;
|
return $this->p;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getParameterKey(String $input = '') {
|
protected function getParameterKey($input = '') {
|
||||||
$params = $this->getParameters();
|
$params = $this->getParameters();
|
||||||
$tab = 'Sections';
|
$tab = 'Sections';
|
||||||
if ($input === 'd') {
|
if ($input === 'd') {
|
||||||
|
@ -203,7 +203,7 @@ class NineGagBridge extends BridgeAbstract {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function getContent(array $post) {
|
protected static function getContent($post) {
|
||||||
if ($post['type'] === 'Animated') {
|
if ($post['type'] === 'Animated') {
|
||||||
$content = self::getAnimated($post);
|
$content = self::getAnimated($post);
|
||||||
} elseif ($post['type'] === 'Article') {
|
} elseif ($post['type'] === 'Article') {
|
||||||
|
@ -215,7 +215,7 @@ class NineGagBridge extends BridgeAbstract {
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function getPhoto(array $post) {
|
protected static function getPhoto($post) {
|
||||||
$image = $post['images']['image460'];
|
$image = $post['images']['image460'];
|
||||||
$photo = '<picture>';
|
$photo = '<picture>';
|
||||||
$photo .= sprintf(
|
$photo .= sprintf(
|
||||||
|
@ -233,7 +233,7 @@ class NineGagBridge extends BridgeAbstract {
|
||||||
return $photo;
|
return $photo;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function getAnimated(array $post) {
|
protected static function getAnimated($post) {
|
||||||
$poster = $post['images']['image460']['url'];
|
$poster = $post['images']['image460']['url'];
|
||||||
$sources = $post['images'];
|
$sources = $post['images'];
|
||||||
$video = sprintf(
|
$video = sprintf(
|
||||||
|
@ -258,7 +258,7 @@ class NineGagBridge extends BridgeAbstract {
|
||||||
return $video;
|
return $video;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function getArticle(array $post) {
|
protected static function getArticle($post) {
|
||||||
$blocks = $post['article']['blocks'];
|
$blocks = $post['article']['blocks'];
|
||||||
$medias = $post['article']['medias'];
|
$medias = $post['article']['medias'];
|
||||||
$contents = array();
|
$contents = array();
|
||||||
|
@ -281,7 +281,7 @@ class NineGagBridge extends BridgeAbstract {
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function getRichText(string $text = '') {
|
protected static function getRichText($text = '') {
|
||||||
$text = trim($text);
|
$text = trim($text);
|
||||||
|
|
||||||
if (preg_match('/^>\s(?<text>.*)/', $text, $matches)) {
|
if (preg_match('/^>\s(?<text>.*)/', $text, $matches)) {
|
||||||
|
@ -301,7 +301,7 @@ class NineGagBridge extends BridgeAbstract {
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function getCategories(array $post) {
|
protected static function getCategories($post) {
|
||||||
$params = self::PARAMETERS;
|
$params = self::PARAMETERS;
|
||||||
$sections = $params['Sections']['g']['values'];
|
$sections = $params['Sections']['g']['values'];
|
||||||
$postSections = $post['sections'];
|
$postSections = $post['sections'];
|
||||||
|
@ -312,7 +312,7 @@ class NineGagBridge extends BridgeAbstract {
|
||||||
return $postSections;
|
return $postSections;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function getTimestamp(array $post) {
|
protected static function getTimestamp($post) {
|
||||||
$url = $post['images']['image460']['url'];
|
$url = $post['images']['image460']['url'];
|
||||||
$headers = get_headers($url, true);
|
$headers = get_headers($url, true);
|
||||||
$date = $headers['Date'];
|
$date = $headers['Date'];
|
||||||
|
|
Loading…
Reference in a new issue