mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-26 17:44:49 +02:00
[phpcs] Add missing rules
- Do not add spaces after opening or before closing parenthesis // Wrong if( !is_null($var) ) { ... } // Right if(!is_null($var)) { ... } - Add space after closing parenthesis // Wrong if(true){ ... } // Right if(true) { ... } - Add body into new line - Close body in new line // Wrong if(true) { ... } // Right if(true) { ... } Notice: Spaces after keywords are not detected: // Wrong (not detected) // -> space after 'if' and missing space after 'else' if (true) { ... } else{ ... } // Right if(true) { ... } else { ... }
This commit is contained in:
@@ -19,10 +19,10 @@ class LegifranceJOBridge extends BridgeAbstract {
|
||||
$item['uri'] = $this->uri . '#' . count($this->items);
|
||||
$item['title'] = $section->plaintext;
|
||||
|
||||
if(!is_null($origin)){
|
||||
if(!is_null($origin)) {
|
||||
$item['title'] = '[ ' . $item['title'] . ' / ' . $subsection->plaintext . ' ] ' . $origin->plaintext;
|
||||
$data = $origin;
|
||||
} elseif(!is_null($subsection)){
|
||||
} elseif(!is_null($subsection)) {
|
||||
$item['title'] = '[ ' . $item['title'] . ' ] ' . $subsection->plaintext;
|
||||
$data = $subsection;
|
||||
} else {
|
||||
@@ -30,7 +30,7 @@ class LegifranceJOBridge extends BridgeAbstract {
|
||||
}
|
||||
|
||||
$item['content'] = '';
|
||||
foreach($data->nextSibling()->find('a') as $content){
|
||||
foreach($data->nextSibling()->find('a') as $content) {
|
||||
$text = $content->plaintext;
|
||||
$href = $content->nextSibling()->getAttribute('resource');
|
||||
$item['content'] .= '<p><a href="' . $href . '">' . $text . '</a></p>';
|
||||
@@ -47,19 +47,19 @@ class LegifranceJOBridge extends BridgeAbstract {
|
||||
$this->uri = trim(substr($uri, strpos($uri, 'https')));
|
||||
$this->timestamp = strtotime(substr($this->uri, strpos($this->uri, 'eli/jo/') + strlen('eli/jo/')));
|
||||
|
||||
foreach($html->find('h3') as $section){
|
||||
foreach($html->find('h3') as $section) {
|
||||
$subsections = $section->nextSibling()->find('h4');
|
||||
foreach($subsections as $subsection){
|
||||
foreach($subsections as $subsection) {
|
||||
$origins = $subsection->nextSibling()->find('h5');
|
||||
foreach($origins as $origin){
|
||||
foreach($origins as $origin) {
|
||||
$this->items[] = $this->extractItem($section, $subsection, $origin);
|
||||
}
|
||||
if(!empty($origins)){
|
||||
if(!empty($origins)) {
|
||||
continue;
|
||||
}
|
||||
$this->items[] = $this->extractItem($section, $subsection);
|
||||
}
|
||||
if(!empty($subsections)){
|
||||
if(!empty($subsections)) {
|
||||
continue;
|
||||
}
|
||||
$this->items[] = $this->extractItem($section);
|
||||
|
Reference in New Issue
Block a user