1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-29 11:00:10 +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:
logmanoriginal
2017-07-29 19:28:00 +02:00
parent 38b56bf23a
commit a4b9611e66
128 changed files with 692 additions and 694 deletions

View File

@@ -18,7 +18,7 @@ class T411Bridge extends BridgeAbstract {
//Utility function for retrieving text based on start and end delimiters
function extractFromDelimiters($string, $start, $end){
if(strpos($string, $start) !== false){
if(strpos($string, $start) !== false) {
$section_retrieved = substr($string, strpos($string, $start) + strlen($start));
$section_retrieved = substr($section_retrieved, 0, strpos($section_retrieved, $end));
return $section_retrieved;
@@ -42,13 +42,13 @@ class T411Bridge extends BridgeAbstract {
$limit = 0;
//Process each item individually
foreach($results->find('tr') as $element){
foreach($results->find('tr') as $element) {
//Limit total amount of requests and ignore table header
if($limit >= 10){
if($limit >= 10) {
break;
}
if(is_object($element->find('th', 0))){
if(is_object($element->find('th', 0))) {
continue;
}
@@ -65,7 +65,7 @@ class T411Bridge extends BridgeAbstract {
//Retrieve full description from torrent page
$item_html = getSimpleHTMLDOM($item_uri);
if(!$item_html){
if(!$item_html) {
continue;
}