Reformat codebase v4 (#2872)

Reformat code base to PSR12

Co-authored-by: rssbridge <noreply@github.com>
This commit is contained in:
Dag 2022-07-01 15:10:30 +02:00 committed by GitHub
parent 66568e3a39
commit 4f75591060
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
398 changed files with 58607 additions and 56442 deletions

View file

@ -1,63 +1,66 @@
<?php
class SplCenterBridge extends FeedExpander {
const NAME = 'Southern Poverty Law Center Bridge';
const URI = 'https://www.splcenter.org';
const DESCRIPTION = 'Returns the newest posts from the Southern Poverty Law Center';
const MAINTAINER = 'VerifiedJoseph';
const PARAMETERS = array(array(
'content' => array(
'name' => 'Content',
'type' => 'list',
'values' => array(
'News' => 'news',
'Hatewatch' => 'hatewatch',
),
'defaultValue' => 'news',
)
)
);
class SplCenterBridge extends FeedExpander
{
const NAME = 'Southern Poverty Law Center Bridge';
const URI = 'https://www.splcenter.org';
const DESCRIPTION = 'Returns the newest posts from the Southern Poverty Law Center';
const MAINTAINER = 'VerifiedJoseph';
const PARAMETERS = [[
'content' => [
'name' => 'Content',
'type' => 'list',
'values' => [
'News' => 'news',
'Hatewatch' => 'hatewatch',
],
'defaultValue' => 'news',
]
]
];
const CACHE_TIMEOUT = 3600; // 1 hour
const CACHE_TIMEOUT = 3600; // 1 hour
protected function parseItem($item) {
$item = parent::parseItem($item);
protected function parseItem($item)
{
$item = parent::parseItem($item);
$articleHtml = getSimpleHTMLDOMCached($item['uri']);
$articleHtml = getSimpleHTMLDOMCached($item['uri']);
foreach ($articleHtml->find('.file') as $index => $media) {
$articleHtml->find('div.file', $index)->outertext = '<em>' . $media->outertext . '</em>';
}
foreach ($articleHtml->find('.file') as $index => $media) {
$articleHtml->find('div.file', $index)->outertext = '<em>' . $media->outertext . '</em>';
}
$item['content'] = $articleHtml->find('div#group-content-container', 0)->innertext;
$item['enclosures'][] = $articleHtml->find('meta[name="twitter:image"]', 0)->content;
$item['content'] = $articleHtml->find('div#group-content-container', 0)->innertext;
$item['enclosures'][] = $articleHtml->find('meta[name="twitter:image"]', 0)->content;
return $item;
}
return $item;
}
public function collectData() {
$this->collectExpandableDatas($this->getURI() . '/rss.xml');
}
public function collectData()
{
$this->collectExpandableDatas($this->getURI() . '/rss.xml');
}
public function getURI() {
public function getURI()
{
if (!is_null($this->getInput('content'))) {
return self::URI . '/' . $this->getInput('content');
}
if (!is_null($this->getInput('content'))) {
return self::URI . '/' . $this->getInput('content');
}
return parent::getURI();
}
return parent::getURI();
}
public function getName()
{
if (!is_null($this->getInput('content'))) {
$parameters = $this->getParameters();
public function getName() {
$contentValues = array_flip($parameters[0]['content']['values']);
if (!is_null($this->getInput('content'))) {
$parameters = $this->getParameters();
return $contentValues[$this->getInput('content')] . ' - Southern Poverty Law Center';
}
$contentValues = array_flip($parameters[0]['content']['values']);
return $contentValues[$this->getInput('content')] . ' - Southern Poverty Law Center';
}
return parent::getName();
}
return parent::getName();
}
}