From a4b9611e66d3095c943a5c63306965d4e4cbf839 Mon Sep 17 00:00:00 2001
From: logmanoriginal <logmanoriginal@users.noreply.github.com>
Date: Sat, 29 Jul 2017 19:28:00 +0200
Subject: [PATCH] [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 {
    ...
  }
---
 bridges/ABCTabsBridge.php               |  3 +-
 bridges/AllocineFRBridge.php            | 11 ++--
 bridges/AmazonBridge.php                |  2 +-
 bridges/AnimeUltimeBridge.php           |  2 +-
 bridges/Arte7Bridge.php                 |  4 +-
 bridges/AskfmBridge.php                 |  8 +--
 bridges/BandcampBridge.php              |  6 +-
 bridges/BastaBridge.php                 |  4 +-
 bridges/BlaguesDeMerdeBridge.php        |  4 +-
 bridges/BooruprojectBridge.php          |  4 +-
 bridges/CADBridge.php                   |  2 +-
 bridges/CNETBridge.php                  | 12 ++--
 bridges/CastorusBridge.php              |  8 +--
 bridges/CollegeDeFranceBridge.php       |  4 +-
 bridges/CopieDoubleBridge.php           |  6 +-
 bridges/CourrierInternationalBridge.php |  6 +-
 bridges/CpasbienBridge.php              | 10 ++--
 bridges/CryptomeBridge.php              |  6 +-
 bridges/DailymotionBridge.php           | 14 ++---
 bridges/DansTonChatBridge.php           |  2 +-
 bridges/DauphineLibereBridge.php        |  2 +-
 bridges/DilbertBridge.php               |  2 +-
 bridges/DuckDuckGoBridge.php            |  2 +-
 bridges/EZTVBridge.php                  |  6 +-
 bridges/EliteDangerousGalnetBridge.php  |  2 +-
 bridges/ElsevierBridge.php              | 12 ++--
 bridges/EstCeQuonMetEnProdBridge.php    |  2 +-
 bridges/EtsyBridge.php                  |  8 +--
 bridges/FB2Bridge.php                   | 16 +++---
 bridges/FacebookBridge.php              | 35 ++++++------
 bridges/FeedExpanderExampleBridge.php   |  4 +-
 bridges/FierPandaBridge.php             |  2 +-
 bridges/FilterBridge.php                |  8 +--
 bridges/FlickrBridge.php                | 12 ++--
 bridges/FootitoBridge.php               |  2 +-
 bridges/FourchanBridge.php              | 12 ++--
 bridges/FuturaSciencesBridge.php        |  8 +--
 bridges/GBAtempBridge.php               | 18 +++---
 bridges/GiphyBridge.php                 |  8 +--
 bridges/GithubIssueBridge.php           | 36 ++++++------
 bridges/GithubSearchBridge.php          |  7 +--
 bridges/GizmodoBridge.php               |  4 +-
 bridges/GoComicsBridge.php              |  6 +-
 bridges/GooglePlusPostBridge.php        | 12 ++--
 bridges/GoogleSearchBridge.php          |  8 +--
 bridges/HDWallpapersBridge.php          | 10 ++--
 bridges/HentaiHavenBridge.php           |  2 +-
 bridges/IdenticaBridge.php              |  6 +-
 bridges/InstagramBridge.php             | 16 +++---
 bridges/IsoHuntBridge.php               | 30 +++++-----
 bridges/JapanExpoBridge.php             |  8 +--
 bridges/KATBridge.php                   | 15 +++--
 bridges/KernelBugTrackerBridge.php      | 12 ++--
 bridges/KununuBridge.php                | 12 ++--
 bridges/LWNprevBridge.php               | 34 +++++------
 bridges/LeBonCoinBridge.php             |  8 +--
 bridges/LeMondeInformatiqueBridge.php   |  2 +-
 bridges/LegifranceJOBridge.php          | 16 +++---
 bridges/LesJoiesDuCodeBridge.php        |  6 +-
 bridges/LinkedInCompanyBridge.php       |  4 +-
 bridges/MangareaderBridge.php           | 26 ++++-----
 bridges/MixCloudBridge.php              |  6 +-
 bridges/MoebooruBridge.php              |  2 +-
 bridges/MoinMoinBridge.php              | 32 +++++------
 bridges/MondeDiploBridge.php            |  2 +-
 bridges/MsnMondeBridge.php              |  4 +-
 bridges/NasaApodBridge.php              |  2 +-
 bridges/NeuviemeArtBridge.php           | 10 ++--
 bridges/NextgovBridge.php               |  4 +-
 bridges/NovelUpdatesBridge.php          |  6 +-
 bridges/OpenClassroomsBridge.php        |  4 +-
 bridges/ParuVenduImmoBridge.php         | 22 +++----
 bridges/PickyWallpapersBridge.php       | 10 ++--
 bridges/PinterestBridge.php             | 12 ++--
 bridges/PlanetLibreBridge.php           |  4 +-
 bridges/RTBFBridge.php                  |  8 +--
 bridges/RainbowSixSiegeBridge.php       |  2 +-
 bridges/ReadComicsBridge.php            |  4 +-
 bridges/Releases3DSBridge.php           | 16 +++---
 bridges/ReporterreBridge.php            |  4 +-
 bridges/ScmbBridge.php                  |  2 +-
 bridges/ScoopItBridge.php               |  2 +-
 bridges/SensCritiqueBridge.php          | 10 ++--
 bridges/SexactuBridge.php               | 10 ++--
 bridges/ShanaprojectBridge.php          |  2 +-
 bridges/SoundcloudBridge.php            |  4 +-
 bridges/StripeAPIChangeLogBridge.php    |  2 +-
 bridges/SuperbWallpapersBridge.php      |  6 +-
 bridges/T411Bridge.php                  | 10 ++--
 bridges/TagBoardBridge.php              |  6 +-
 bridges/TheCodingLoveBridge.php         |  6 +-
 bridges/TheHackerNewsBridge.php         | 10 ++--
 bridges/ThePirateBayBridge.php          | 18 +++---
 bridges/TheTVDBBridge.php               | 12 ++--
 bridges/Torrent9Bridge.php              | 12 ++--
 bridges/TwitterBridge.php               | 32 +++++------
 bridges/UnsplashBridge.php              |  6 +-
 bridges/UsbekEtRicaBridge.php           | 20 +++----
 bridges/ViadeoCompanyBridge.php         |  4 +-
 bridges/VineBridge.php                  |  2 +-
 bridges/VkBridge.php                    | 10 ++--
 bridges/WallpaperStopBridge.php         | 10 ++--
 bridges/WeLiveSecurityBridge.php        |  4 +-
 bridges/WebfailBridge.php               | 16 +++---
 bridges/WhydBridge.php                  |  8 +--
 bridges/WikiLeaksBridge.php             | 18 +++---
 bridges/WikipediaBridge.php             | 24 ++++----
 bridges/WordPressBridge.php             | 10 ++--
 bridges/WordPressPluginUpdateBridge.php |  2 +-
 bridges/WorldOfTanksBridge.php          |  4 +-
 bridges/YoutubeBridge.php               | 22 +++----
 bridges/ZDNetBridge.php                 | 24 ++++----
 caches/FileCache.php                    | 14 ++---
 formats/AtomFormat.php                  |  6 +-
 formats/HtmlFormat.php                  | 10 ++--
 formats/MrssFormat.php                  | 10 ++--
 index.php                               | 42 +++++++-------
 lib/Bridge.php                          | 20 +++----
 lib/BridgeAbstract.php                  | 76 ++++++++++++-------------
 lib/Cache.php                           | 10 ++--
 lib/FeedExpander.php                    | 36 ++++++------
 lib/Format.php                          | 16 +++---
 lib/FormatAbstract.php                  |  8 +--
 lib/RssBridge.php                       |  2 +-
 lib/contents.php                        | 18 +++---
 lib/html.php                            | 48 ++++++++--------
 lib/validation.php                      | 20 +++----
 phpcs.xml                               |  9 +++
 128 files changed, 692 insertions(+), 694 deletions(-)

diff --git a/bridges/ABCTabsBridge.php b/bridges/ABCTabsBridge.php
index d44cba24..2e451e28 100644
--- a/bridges/ABCTabsBridge.php
+++ b/bridges/ABCTabsBridge.php
@@ -13,8 +13,7 @@ class ABCTabsBridge extends BridgeAbstract {
 
 		$table = $html->find('table#myTable', 0)->children(1);
 
-		foreach ($table->find('tr') as $tab)
-		{
+		foreach ($table->find('tr') as $tab) {
 			$item = array();
 			$item['author'] = $tab->find('td', 1)->plaintext
 			. ' - '
diff --git a/bridges/AllocineFRBridge.php b/bridges/AllocineFRBridge.php
index d5f2b7e3..604199b2 100644
--- a/bridges/AllocineFRBridge.php
+++ b/bridges/AllocineFRBridge.php
@@ -22,9 +22,9 @@ class AllocineFRBridge extends BridgeAbstract {
 	));
 
 	public function getURI(){
-		if(!is_null($this->getInput('category'))){
+		if(!is_null($this->getInput('category'))) {
 
-			switch($this->getInput('category')){
+			switch($this->getInput('category')) {
 			case 'faux-raccord':
 				$uri = static::URI . 'video/programme-12284/saison-29841/';
 				break;
@@ -43,7 +43,7 @@ class AllocineFRBridge extends BridgeAbstract {
 	}
 
 	public function getName(){
-		if(!is_null($this->getInput('category'))){
+		if(!is_null($this->getInput('category'))) {
 			return self::NAME . ' : '
 				.array_search(
 					$this->getInput('category'),
@@ -64,15 +64,14 @@ class AllocineFRBridge extends BridgeAbstract {
 				self::PARAMETERS[$this->queriedContext]['category']['values']
 			);
 
-		foreach($html->find('figure.media-meta-fig') as $element){
+		foreach($html->find('figure.media-meta-fig') as $element) {
 			$item = array();
 
 			$title = $element->find('div.titlebar h3.title a', 0);
 			$content = trim($element->innertext);
 			$figCaption = strpos($content, $category);
 
-			if($figCaption !== false)
-			{
+			if($figCaption !== false) {
 				$content = str_replace('src="/', 'src="' . static::URI, $content);
 				$content = str_replace('href="/', 'href="' . static::URI, $content);
 				$content = str_replace('src=\'/', 'src=\'' . static::URI, $content);
diff --git a/bridges/AmazonBridge.php b/bridges/AmazonBridge.php
index d7f77c51..cbc61190 100644
--- a/bridges/AmazonBridge.php
+++ b/bridges/AmazonBridge.php
@@ -51,7 +51,7 @@ class AmazonBridge extends BridgeAbstract {
 	));
 
 	public function getName(){
-		if(!is_null($this->getInput('tld')) && !is_null($this->getInput('q'))){
+		if(!is_null($this->getInput('tld')) && !is_null($this->getInput('q'))) {
 			return 'Amazon.'.$this->getInput('tld').': '.$this->getInput('q');
 		}
 
diff --git a/bridges/AnimeUltimeBridge.php b/bridges/AnimeUltimeBridge.php
index caedba1e..6c5427e5 100644
--- a/bridges/AnimeUltimeBridge.php
+++ b/bridges/AnimeUltimeBridge.php
@@ -120,7 +120,7 @@ class AnimeUltimeBridge extends BridgeAbstract {
 	}
 
 	public function getName() {
-		if(!is_null($this->getInput('type'))){
+		if(!is_null($this->getInput('type'))) {
 			$typeFilter = array_search(
 				$this->getInput('type'),
 				self::PARAMETERS[$this->queriedContext]['type']['values']
diff --git a/bridges/Arte7Bridge.php b/bridges/Arte7Bridge.php
index 09a1ee4d..3d7ae9de 100644
--- a/bridges/Arte7Bridge.php
+++ b/bridges/Arte7Bridge.php
@@ -44,7 +44,7 @@ class Arte7Bridge extends BridgeAbstract {
 	);
 
 	public function collectData(){
-		switch($this->queriedContext){
+		switch($this->queriedContext) {
 		case 'Catégorie (Français)':
 			$category = $this->getInput('catfr');
 			$lang = 'fr';
@@ -58,7 +58,7 @@ class Arte7Bridge extends BridgeAbstract {
 		$url = self::URI . 'guide/' . $lang . '/plus7/' . $category;
 		$input = getContents($url) or die('Could not request ARTE.');
 
-		if(strpos($input, 'categoryVideoSet') !== false){
+		if(strpos($input, 'categoryVideoSet') !== false) {
 			$input = explode('categoryVideoSet="', $input);
 			$input = explode('}}', $input[1]);
 			$input = $input[0] . '}}';
diff --git a/bridges/AskfmBridge.php b/bridges/AskfmBridge.php
index 4b1597db..e2274618 100644
--- a/bridges/AskfmBridge.php
+++ b/bridges/AskfmBridge.php
@@ -19,7 +19,7 @@ class AskfmBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM($this->getURI())
 			or returnServerError('Requested username can\'t be found.');
 
-		foreach($html->find('div.streamItem-answer') as $element){
+		foreach($html->find('div.streamItem-answer') as $element) {
 			$item = array();
 			$item['uri'] = self::URI . $element->find('a.streamItemsAge', 0)->href;
 			$question = trim($element->find('h1.streamItemContent-question', 0)->innertext);
@@ -38,7 +38,7 @@ class AskfmBridge extends BridgeAbstract {
 			// This probably should be cleaned up, especially for YouTube embeds
 			$visual = $element->find('div.streamItemContent-visual', 0)->innertext;
 			//Fix tracking links, also doesn't work
-			foreach($element->find('a') as $link){
+			foreach($element->find('a') as $link) {
 				if(strpos($link->href, 'l.ask.fm') !== false) {
 
 					// Too slow
@@ -57,7 +57,7 @@ class AskfmBridge extends BridgeAbstract {
 	}
 
 	public function getName(){
-		if(!is_null($this->getInput('u'))){
+		if(!is_null($this->getInput('u'))) {
 			return self::NAME . ' : ' . $this->getInput('u');
 		}
 
@@ -65,7 +65,7 @@ class AskfmBridge extends BridgeAbstract {
 	}
 
 	public function getURI(){
-		if(!is_null($this->getInput('u'))){
+		if(!is_null($this->getInput('u'))) {
 			return self::URI . urlencode($this->getInput('u')) . '/answers/more?page=0';
 		}
 
diff --git a/bridges/BandcampBridge.php b/bridges/BandcampBridge.php
index 28e9ba57..0527da03 100644
--- a/bridges/BandcampBridge.php
+++ b/bridges/BandcampBridge.php
@@ -18,7 +18,7 @@ class BandcampBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM($this->getURI())
 			or returnServerError('No results for this query.');
 
-		foreach($html->find('li.item') as $release){
+		foreach($html->find('li.item') as $release) {
 			$script = $release->find('div.art', 0)->getAttribute('onclick');
 			$uri = ltrim($script, "return 'url(");
 			$uri = rtrim($uri, "')");
@@ -46,7 +46,7 @@ class BandcampBridge extends BridgeAbstract {
 	}
 
 	public function getURI(){
-		if(!is_null($this->getInput('tag'))){
+		if(!is_null($this->getInput('tag'))) {
 			return self::URI . 'tag/' . urlencode($this->getInput('tag')) . '?sort_field=date';
 		}
 
@@ -54,7 +54,7 @@ class BandcampBridge extends BridgeAbstract {
 	}
 
 	public function getName(){
-		if(!is_null($this->getInput('tag'))){
+		if(!is_null($this->getInput('tag'))) {
 			return $this->getInput('tag') . ' - Bandcamp Tag';
 		}
 
diff --git a/bridges/BastaBridge.php b/bridges/BastaBridge.php
index 11a31ac8..17d3da76 100644
--- a/bridges/BastaBridge.php
+++ b/bridges/BastaBridge.php
@@ -19,8 +19,8 @@ class BastaBridge extends BridgeAbstract {
 
 		$limit = 0;
 
-		foreach($html->find('item') as $element){
-			if($limit < 10){
+		foreach($html->find('item') as $element) {
+			if($limit < 10) {
 				$item = array();
 				$item['title'] = $element->find('title', 0)->innertext;
 				$item['uri'] = $element->find('guid', 0)->plaintext;
diff --git a/bridges/BlaguesDeMerdeBridge.php b/bridges/BlaguesDeMerdeBridge.php
index 12814a50..25c018a8 100644
--- a/bridges/BlaguesDeMerdeBridge.php
+++ b/bridges/BlaguesDeMerdeBridge.php
@@ -11,11 +11,11 @@ class BlaguesDeMerdeBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM(self::URI)
 			or returnServerError('Could not request BDM.');
 
-		foreach($html->find('article.joke_contener') as $element){
+		foreach($html->find('article.joke_contener') as $element) {
 			$item = array();
 			$temp = $element->find('a');
 
-			if(isset($temp[2])){
+			if(isset($temp[2])) {
 				$item['content'] = trim($element->find('div.joke_text_contener', 0)->innertext);
 				$uri = $temp[2]->href;
 				$item['uri'] = $uri;
diff --git a/bridges/BooruprojectBridge.php b/bridges/BooruprojectBridge.php
index 1219b72f..6815d370 100644
--- a/bridges/BooruprojectBridge.php
+++ b/bridges/BooruprojectBridge.php
@@ -28,7 +28,7 @@ class BooruprojectBridge extends GelbooruBridge {
 	const PIDBYPAGE = 20;
 
 	public function getURI(){
-		if(!is_null($this->getInput('i'))){
+		if(!is_null($this->getInput('i'))) {
 			return 'http://' . $this->getInput('i') . '.booru.org/';
 		}
 
@@ -36,7 +36,7 @@ class BooruprojectBridge extends GelbooruBridge {
 	}
 
 	public function getName(){
-		if(!is_null($this->getInput('i'))){
+		if(!is_null($this->getInput('i'))) {
 			return static::NAME . ' ' . $this->getInput('i');
 		}
 
diff --git a/bridges/CADBridge.php b/bridges/CADBridge.php
index 761d77f4..09e3e65a 100644
--- a/bridges/CADBridge.php
+++ b/bridges/CADBridge.php
@@ -25,7 +25,7 @@ class CADBridge extends FeedExpander {
 
 		$htmlpart = explode("/", $url);
 
-		switch ($htmlpart[3]){
+		switch ($htmlpart[3]) {
 			case 'cad':
 				preg_match_all("/http:\/\/cdn2\.cad-comic\.com\/comics\/cad-\S*png/", $html3, $url2);
 				break;
diff --git a/bridges/CNETBridge.php b/bridges/CNETBridge.php
index 0abd02cc..eefb7051 100644
--- a/bridges/CNETBridge.php
+++ b/bridges/CNETBridge.php
@@ -17,7 +17,7 @@ topic found in some section URLs, else all topics are selected.';
 	public function collectData(){
 
 		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;
@@ -27,7 +27,7 @@ topic found in some section URLs, else all topics are selected.';
 		}
 
 		function stripWithDelimiters($string, $start, $end){
-			while(strpos($string, $start) !== false){
+			while(strpos($string, $start) !== false) {
 				$section_to_remove = substr($string, strpos($string, $start));
 				$section_to_remove = substr($section_to_remove, 0, strpos($section_to_remove, $end) + strlen($end));
 				$string = str_replace($section_to_remove, '', $string);
@@ -49,14 +49,14 @@ topic found in some section URLs, else all topics are selected.';
 		$html = getSimpleHTMLDOM($pageUrl) or returnServerError('Could not request CNET: ' . $pageUrl);
 		$limit = 0;
 
-		foreach($html->find('div.assetBody') as $element){
-			if($limit < 8){
+		foreach($html->find('div.assetBody') as $element) {
+			if($limit < 8) {
 				$article_title = trim($element->find('h2', 0)->plaintext);
 				$article_uri = self::URI . ($element->find('a', 0)->href);
 				$article_timestamp = strtotime($element->find('time.assetTime', 0)->plaintext);
 				$article_author = trim($element->find('a[rel=author]', 0)->plaintext);
 
-				if(!empty($article_title) && !empty($article_uri) && strpos($article_uri, '/news/') !== false){
+				if(!empty($article_title) && !empty($article_uri) && strpos($article_uri, '/news/') !== false) {
 					$article_html = getSimpleHTMLDOM($article_uri)
 						or returnServerError('Could not request CNET: ' . $article_uri);
 					$article_content = trim(
@@ -83,7 +83,7 @@ topic found in some section URLs, else all topics are selected.';
 	}
 
 	public function getName(){
-		if(!is_null($this->getInput('topic'))){
+		if(!is_null($this->getInput('topic'))) {
 			$topic = $this->getInput('topic');
 			return 'CNET News Bridge' . (empty($topic) ? '' : ' - ' . $topic);
 		}
diff --git a/bridges/CastorusBridge.php b/bridges/CastorusBridge.php
index 119d3535..3ed1331e 100644
--- a/bridges/CastorusBridge.php
+++ b/bridges/CastorusBridge.php
@@ -57,7 +57,7 @@ class CastorusBridge extends BridgeAbstract {
 		if(!$nodes)
 			returnServerError('Cannot find nodes!');
 
-		foreach($nodes as $node){
+		foreach($nodes as $node) {
 			$node->outertext = '';
 		}
 
@@ -88,7 +88,7 @@ class CastorusBridge extends BridgeAbstract {
 		if(!$activities)
 			returnServerError('Failed to find activities!');
 
-		foreach($activities as $activity){
+		foreach($activities as $activity) {
 			$item = array();
 
 			$item['title'] = $this->extractActivityTitle($activity);
@@ -103,12 +103,12 @@ class CastorusBridge extends BridgeAbstract {
 			. '</p>';
 
 			if(isset($zip_filter)
-			&& !(substr($item['title'], 0, strlen($zip_filter)) === $zip_filter)){
+			&& !(substr($item['title'], 0, strlen($zip_filter)) === $zip_filter)) {
 				continue; // Skip this item
 			}
 
 			if(isset($city_filter)
-			&& !(substr($item['title'], strpos($item['title'], ' ') + 1, strlen($city_filter)) === $city_filter)){
+			&& !(substr($item['title'], strpos($item['title'], ' ') + 1, strlen($city_filter)) === $city_filter)) {
 				continue; // Skip this item
 			}
 
diff --git a/bridges/CollegeDeFranceBridge.php b/bridges/CollegeDeFranceBridge.php
index 6a570948..1f816832 100644
--- a/bridges/CollegeDeFranceBridge.php
+++ b/bridges/CollegeDeFranceBridge.php
@@ -37,7 +37,7 @@ class CollegeDeFranceBridge extends BridgeAbstract {
 		. 'components/search-audiovideo.jsp?fulltext=&siteid=1156951719600&lang=FR&type=all')
 			or returnServerError('Could not request CollegeDeFrance.');
 
-		foreach($html->find('a[data-target]') as $element){
+		foreach($html->find('a[data-target]') as $element) {
 			$item = array();
 			$item['title'] = $element->find('.title', 0)->plaintext;
 
@@ -60,7 +60,7 @@ class CollegeDeFranceBridge extends BridgeAbstract {
 				$timezone
 			);
 
-			if(!$d){
+			if(!$d) {
 				$d = DateTime::createFromFormat(
 					'!d m Y',
 					trim(str_replace(
diff --git a/bridges/CopieDoubleBridge.php b/bridges/CopieDoubleBridge.php
index af805f21..767cdce3 100644
--- a/bridges/CopieDoubleBridge.php
+++ b/bridges/CopieDoubleBridge.php
@@ -13,16 +13,16 @@ class CopieDoubleBridge extends BridgeAbstract {
 
 		$table = $html->find('table table', 2);
 
-		foreach($table->find('tr') as $element){
+		foreach($table->find('tr') as $element) {
 			$td = $element->find('td', 0);
 
-			if($td->class === 'couleur_1'){
+			if($td->class === 'couleur_1') {
 				$item = array();
 				$title = $td->innertext;
 				$pos = strpos($title, '<a');
 				$title = substr($title, 0, $pos);
 				$item['title'] = $title;
-			} elseif(strpos($element->innertext, '/images/suivant.gif') === false){
+			} elseif(strpos($element->innertext, '/images/suivant.gif') === false) {
 				$a = $element->find('a', 0);
 				$item['uri'] = self::URI . $a->href;
 				$content = str_replace('src="/', 'src="/' . self::URI, $element->find("td", 0)->innertext);
diff --git a/bridges/CourrierInternationalBridge.php b/bridges/CourrierInternationalBridge.php
index e666bfd5..15738633 100644
--- a/bridges/CourrierInternationalBridge.php
+++ b/bridges/CourrierInternationalBridge.php
@@ -14,12 +14,12 @@ class CourrierInternationalBridge extends BridgeAbstract {
 		$element = $html->find("article");
 		$article_count = 1;
 
-		foreach($element as $article){
+		foreach($element as $article) {
 			$item = array();
 
 			$item['uri'] = $article->parent->getAttribute('href');
 
-			if(strpos($item['uri'], 'http') === false){
+			if(strpos($item['uri'], 'http') === false) {
 				$item['uri'] = self::URI . $item['uri'];
 			}
 
@@ -27,7 +27,7 @@ class CourrierInternationalBridge extends BridgeAbstract {
 
 			$content = $page->find('.article-text', 0);
 
-			if(!$content){
+			if(!$content) {
 				$content = $page->find('.depeche-text', 0);
 			}
 
diff --git a/bridges/CpasbienBridge.php b/bridges/CpasbienBridge.php
index 9ca95f44..19efd84a 100644
--- a/bridges/CpasbienBridge.php
+++ b/bridges/CpasbienBridge.php
@@ -20,9 +20,9 @@ class CpasbienBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM(self::URI . '/recherche/' . urlencode($request) . '.html')
 			or returnServerError('No results for this query.');
 
-		foreach($html->find('#gauche', 0)->find('div') as $episode){
+		foreach($html->find('#gauche', 0)->find('div') as $episode) {
 			if($episode->getAttribute('class') == 'ligne0'
-			|| $episode->getAttribute('class') == 'ligne1'){
+			|| $episode->getAttribute('class') == 'ligne1') {
 
 				$urlepisode = $episode->find('a', 0)->getAttribute('href');
 				$htmlepisode = getSimpleHTMLDOMCached($urlepisode, 86400 * 366 * 30);
@@ -33,11 +33,11 @@ class CpasbienBridge extends BridgeAbstract {
 				$item['pubdate'] = $this->getCachedDate($urlepisode);
 				$textefiche = $htmlepisode->find('#textefiche', 0)->find('p', 1);
 
-				if(isset($textefiche)){
+				if(isset($textefiche)) {
 					$item['content'] = $textefiche->text();
 				} else {
 					$p = $htmlepisode->find('#textefiche', 0)->find('p');
-					if(!empty($p)){
+					if(!empty($p)) {
 						$item['content'] = $htmlepisode->find('#textefiche', 0)->find('p', 0)->text();
 					}
 				}
@@ -50,7 +50,7 @@ class CpasbienBridge extends BridgeAbstract {
 	}
 
 	public function getName(){
-		if(!is_null($this->getInput('q'))){
+		if(!is_null($this->getInput('q'))) {
 			return $this->getInput('q') . ' : ' . self::NAME;
 		}
 
diff --git a/bridges/CryptomeBridge.php b/bridges/CryptomeBridge.php
index 78fec3c1..8a3936f4 100644
--- a/bridges/CryptomeBridge.php
+++ b/bridges/CryptomeBridge.php
@@ -23,12 +23,12 @@ class CryptomeBridge extends BridgeAbstract {
 		$number = $this->getInput('n');
 
 		/* number of documents */
-		if(!empty($number)){
+		if(!empty($number)) {
 			$num = min($number, 20);
 		}
 
-		foreach($html->find('pre') as $element){
-			for($i = 0; $i < $num; ++$i){
+		foreach($html->find('pre') as $element) {
+			for($i = 0; $i < $num; ++$i) {
 				$item = array();
 				$item['uri'] = self::URI . substr($element->find('a', $i)->href, 20);
 				$item['title'] = substr($element->find('b', $i)->plaintext, 22);
diff --git a/bridges/DailymotionBridge.php b/bridges/DailymotionBridge.php
index 15ea52ff..d075041c 100644
--- a/bridges/DailymotionBridge.php
+++ b/bridges/DailymotionBridge.php
@@ -35,7 +35,7 @@ class DailymotionBridge extends BridgeAbstract {
 	protected function getMetadata($id){
 		$metadata = array();
 		$html2 = getSimpleHTMLDOM(self::URI . 'video/' . $id);
-		if(!$html2){
+		if(!$html2) {
 			return $metadata;
 		}
 
@@ -56,12 +56,12 @@ class DailymotionBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM($this->getURI())
 			or returnServerError('Could not request Dailymotion.');
 
-		foreach($html->find('div.media a.preview_link') as $element){
-			if($count < $limit){
+		foreach($html->find('div.media a.preview_link') as $element) {
+			if($count < $limit) {
 				$item = array();
 				$item['id'] = str_replace('/video/', '', strtok($element->href, '_'));
 				$metadata = $this->getMetadata($item['id']);
-				if(empty($metadata)){
+				if(empty($metadata)) {
 					continue;
 				}
 				$item['uri'] = $metadata['uri'];
@@ -85,7 +85,7 @@ class DailymotionBridge extends BridgeAbstract {
 	}
 
 	public function getName(){
-		switch($this->queriedContext){
+		switch($this->queriedContext) {
 		case 'By username':
 			$specific = $this->getInput('u');
 			break;
@@ -103,7 +103,7 @@ class DailymotionBridge extends BridgeAbstract {
 
 	public function getURI(){
 		$uri = self::URI;
-		switch($this->queriedContext){
+		switch($this->queriedContext) {
 		case 'By username':
 			$uri .= 'user/' . urlencode($this->getInput('u')) . '/1';
 			break;
@@ -112,7 +112,7 @@ class DailymotionBridge extends BridgeAbstract {
 			break;
 		case 'From search results':
 			$uri .= 'search/' . urlencode($this->getInput('s'));
-			if($this->getInput('pa')){
+			if($this->getInput('pa')) {
 				$uri .= '/' . $this->getInput('pa');
 			}
 			break;
diff --git a/bridges/DansTonChatBridge.php b/bridges/DansTonChatBridge.php
index 56bb4c19..545f1628 100644
--- a/bridges/DansTonChatBridge.php
+++ b/bridges/DansTonChatBridge.php
@@ -12,7 +12,7 @@ class DansTonChatBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM(self::URI . 'latest.html')
 			or returnServerError('Could not request DansTonChat.');
 
-		foreach($html->find('div.item') as $element){
+		foreach($html->find('div.item') as $element) {
 			$item = array();
 			$item['uri'] = $element->find('a', 0)->href;
 			$item['title'] = 'DansTonChat ' . $element->find('a', 1)->plaintext;
diff --git a/bridges/DauphineLibereBridge.php b/bridges/DauphineLibereBridge.php
index 35783358..7547d740 100644
--- a/bridges/DauphineLibereBridge.php
+++ b/bridges/DauphineLibereBridge.php
@@ -34,7 +34,7 @@ class DauphineLibereBridge extends FeedExpander {
 	public function collectData(){
 		$url = self::URI . 'rss';
 
-		if(empty($this->getInput('u'))){
+		if(empty($this->getInput('u'))) {
 			$url = self::URI . $this->getInput('u') . '/rss';
 		}
 
diff --git a/bridges/DilbertBridge.php b/bridges/DilbertBridge.php
index 2c5e6396..959a91a2 100644
--- a/bridges/DilbertBridge.php
+++ b/bridges/DilbertBridge.php
@@ -12,7 +12,7 @@ class DilbertBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM($this->getURI())
 			or returnServerError('Could not request Dilbert: ' . $this->getURI());
 
-		foreach($html->find('section.comic-item') as $element){
+		foreach($html->find('section.comic-item') as $element) {
 
 			$img = $element->find('img', 0);
 			$link = $element->find('a', 0);
diff --git a/bridges/DuckDuckGoBridge.php b/bridges/DuckDuckGoBridge.php
index 554a050f..8533be5e 100644
--- a/bridges/DuckDuckGoBridge.php
+++ b/bridges/DuckDuckGoBridge.php
@@ -31,7 +31,7 @@ class DuckDuckGoBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM(self::URI . 'html/?kd=-1&q=' . $this->getInput('u') . $this->getInput('sort'))
 			or returnServerError('Could not request DuckDuckGo.');
 
-		foreach($html->find('div.results_links') as $element){
+		foreach($html->find('div.results_links') as $element) {
 			$item = array();
 			$item['uri'] = $element->find('a', 0)->href;
 			$item['title'] = $element->find('a', 1)->innertext;
diff --git a/bridges/EZTVBridge.php b/bridges/EZTVBridge.php
index f17c2b46..4fb9e578 100644
--- a/bridges/EZTVBridge.php
+++ b/bridges/EZTVBridge.php
@@ -23,7 +23,7 @@ on EZTV. Get showID from URLs in https://eztv.ch/shows/showID/show-full-name.';
 			$relativeDays = 0;
 			$relativeHours = 0;
 
-			foreach(explode(" ", $relativeReleaseTime) as $relativeTimeElement){
+			foreach(explode(" ", $relativeReleaseTime) as $relativeTimeElement) {
 				if(substr($relativeTimeElement, -1) == "d") $relativeDays = substr($relativeTimeElement, 0, -1);
 				if(substr($relativeTimeElement, -1) == "h") $relativeHours = substr($relativeTimeElement, 0, -1);
 			}
@@ -32,14 +32,14 @@ on EZTV. Get showID from URLs in https://eztv.ch/shows/showID/show-full-name.';
 
 		// Loop on show ids
 		$showList = explode(",", $this->getInput('i'));
-		foreach($showList as $showID){
+		foreach($showList as $showID) {
 
 			// Get show page
 			$html = getSimpleHTMLDOM(self::URI . 'shows/' . rawurlencode($showID) . '/')
 				or returnServerError('Could not request EZTV for id "' . $showID . '"');
 
 			// Loop on each element that look like an episode entry...
-			foreach($html->find('.forum_header_border') as $element){
+			foreach($html->find('.forum_header_border') as $element) {
 
 				// Filter entries that are not episode entries
 				$ep = $element->find('td', 1);
diff --git a/bridges/EliteDangerousGalnetBridge.php b/bridges/EliteDangerousGalnetBridge.php
index 4c3362da..86a1bbfc 100644
--- a/bridges/EliteDangerousGalnetBridge.php
+++ b/bridges/EliteDangerousGalnetBridge.php
@@ -11,7 +11,7 @@ class EliteDangerousGalnetBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM(self::URI)
 			or returnServerError('Error while downloading the website content');
 
-		foreach($html->find('div.article') as $element){
+		foreach($html->find('div.article') as $element) {
 			$item = array();
 
 			$uri = $element->find('h3 a', 0)->href;
diff --git a/bridges/ElsevierBridge.php b/bridges/ElsevierBridge.php
index af9f3971..f6ba7ddb 100644
--- a/bridges/ElsevierBridge.php
+++ b/bridges/ElsevierBridge.php
@@ -27,7 +27,7 @@ class ElsevierBridge extends BridgeAbstract {
 	// Extracts the timestamp from an article
 	private function extractArticleTimestamp($article){
 		$time = $article->find('.article-info', 0);
-		if($time){
+		if($time) {
 			$timestring = trim($time->plaintext);
 			/*
 				The format depends on the age of an article:
@@ -35,11 +35,11 @@ class ElsevierBridge extends BridgeAbstract {
 				- July 2016
 				- May–June 2016
 			*/
-			if(preg_match('/\S*(\d+\s\S+\s\d{4})/ims', $timestring, $matches)){
+			if(preg_match('/\S*(\d+\s\S+\s\d{4})/ims', $timestring, $matches)) {
 				return strtotime($matches[0]);
-			} elseif (preg_match('/[A-Za-z]+\-([A-Za-z]+\s\d{4})/ims', $timestring, $matches)){
+			} elseif (preg_match('/[A-Za-z]+\-([A-Za-z]+\s\d{4})/ims', $timestring, $matches)) {
 				return strtotime($matches[0]);
-			} elseif (preg_match('/([A-Za-z]+\s\d{4})/ims', $timestring, $matches)){
+			} elseif (preg_match('/([A-Za-z]+\s\d{4})/ims', $timestring, $matches)) {
 				return strtotime($matches[0]);
 			} else {
 				return 0;
@@ -51,7 +51,7 @@ class ElsevierBridge extends BridgeAbstract {
 	// Extracts the content from an article
 	private function extractArticleContent($article){
 		$content = $article->find('.article-content', 0);
-		if($content){
+		if($content) {
 			return trim($content->plaintext);
 		}
 		return '';
@@ -62,7 +62,7 @@ class ElsevierBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM($uri)
 			or returnServerError('No results for Elsevier journal ' . $this->getInput('j'));
 
-		foreach($html->find('.pod-listing') as $article){
+		foreach($html->find('.pod-listing') as $article) {
 			$item = array();
 			$item['uri'] = $article->find('.pod-listing-header>a', 0)->getAttribute('href') . '?np=y';
 			$item['title'] = $article->find('.pod-listing-header>a', 0)->plaintext;
diff --git a/bridges/EstCeQuonMetEnProdBridge.php b/bridges/EstCeQuonMetEnProdBridge.php
index 5526eae2..db9d1d5f 100644
--- a/bridges/EstCeQuonMetEnProdBridge.php
+++ b/bridges/EstCeQuonMetEnProdBridge.php
@@ -9,7 +9,7 @@ class EstCeQuonMetEnProdBridge extends BridgeAbstract {
 
 	public function collectData(){
 		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;
diff --git a/bridges/EtsyBridge.php b/bridges/EtsyBridge.php
index 756ab107..311d9109 100644
--- a/bridges/EtsyBridge.php
+++ b/bridges/EtsyBridge.php
@@ -38,7 +38,7 @@ class EtsyBridge extends BridgeAbstract {
 
 		$results = $html->find('div.block-grid-item');
 
-		foreach($results as $result){
+		foreach($results as $result) {
 			// Skip banner cards (ads for categories)
 			if($result->find('a.banner-card'))
 				continue;
@@ -57,7 +57,7 @@ class EtsyBridge extends BridgeAbstract {
 
 			$image = $result->find('img.placeholder', 0)->src;
 
-			if($this->getInput('showimage')){
+			if($this->getInput('showimage')) {
 				$item['content'] .= '<img src="' . $image . '">';
 			}
 
@@ -68,10 +68,10 @@ class EtsyBridge extends BridgeAbstract {
 	}
 
 	public function getURI(){
-		if(!is_null($this->getInput('query'))){
+		if(!is_null($this->getInput('query'))) {
 			$uri = self::URI . '/search?q=' . urlencode($this->getInput('query'));
 
-			if(!is_null($this->getInput('queryextension'))){
+			if(!is_null($this->getInput('queryextension'))) {
 				$uri .= $this->getInput('queryextension');
 			}
 
diff --git a/bridges/FB2Bridge.php b/bridges/FB2Bridge.php
index 779b48aa..7d78b87f 100644
--- a/bridges/FB2Bridge.php
+++ b/bridges/FB2Bridge.php
@@ -18,7 +18,7 @@ class FB2Bridge extends BridgeAbstract {
 	public function collectData(){
 
 		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;
@@ -29,7 +29,7 @@ class FB2Bridge extends BridgeAbstract {
 
 		//Utility function for cleaning a Facebook link
 		$unescape_fb_link = function($matches){
-			if(is_array($matches) && count($matches) > 1){
+			if(is_array($matches) && count($matches) > 1) {
 				$link = $matches[1];
 				if(strpos($link, '/') === 0)
 					$link = self::URI . $link . '"';
@@ -72,12 +72,12 @@ class FB2Bridge extends BridgeAbstract {
 			return $matches[0];
 		};
 
-		if($this->getInput('u') !== null){
+		if($this->getInput('u') !== null) {
 			$page = 'https://touch.facebook.com/' . $this->getInput('u');
 			$cookies = $this->getCookies($page);
 			$pageID = $this->getPageID($page, $cookies);
 
-			if($pageID === null){
+			if($pageID === null) {
 				echo <<<EOD
 Unable to get the page id. You should consider getting the ID by hand, then importing it into FB2Bridge
 EOD;
@@ -103,7 +103,7 @@ EOD;
 		$html = $this->buildContent($fileContent);
 		$author = $this->getInput('u');
 
-		foreach($html->find("article") as $content){
+		foreach($html->find("article") as $content) {
 
 			$item = array();
 
@@ -223,8 +223,8 @@ EOD;
 
 		//First request to get the cookie
 		$cookies = "";
-		foreach($http_response_header as $hdr){
-			if(strpos($hdr, "Set-Cookie") !== false){
+		foreach($http_response_header as $hdr) {
+			if(strpos($hdr, "Set-Cookie") !== false) {
 				$cLine = explode(":", $hdr)[1];
 				$cLine = explode(";", $cLine)[0];
 				$cookies .= ";" . $cLine;
@@ -255,7 +255,7 @@ EOD;
 		$regex = "/page_id=([0-9]*)&/";
 		preg_match($regex, $pageContent, $matches);
 
-		if(count($matches) > 0){
+		if(count($matches) > 0) {
 			return $matches[1];
 		}
 
diff --git a/bridges/FacebookBridge.php b/bridges/FacebookBridge.php
index 5f6ca6d1..cc16196b 100644
--- a/bridges/FacebookBridge.php
+++ b/bridges/FacebookBridge.php
@@ -32,7 +32,7 @@ class FacebookBridge extends BridgeAbstract {
 
 		//Extract a string using 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;
@@ -43,7 +43,7 @@ class FacebookBridge extends BridgeAbstract {
 
 		//Utility function for cleaning a Facebook link
 		$unescape_fb_link = function($matches){
-			if(is_array($matches) && count($matches) > 1){
+			if(is_array($matches) && count($matches) > 1) {
 				$link = $matches[1];
 				if(strpos($link, '/') === 0)
 					$link = self::URI . $link . '"';
@@ -89,12 +89,10 @@ class FacebookBridge extends BridgeAbstract {
 		$html = null;
 
 		//Handle captcha response sent by the viewer
-		if (isset($_POST['captcha_response']))
-		{
+		if (isset($_POST['captcha_response'])) {
 			if (session_status() == PHP_SESSION_NONE)
 				session_start();
-			if (isset($_SESSION['captcha_fields'], $_SESSION['captcha_action']))
-			{
+			if (isset($_SESSION['captcha_fields'], $_SESSION['captcha_action'])) {
 				$captcha_action = $_SESSION['captcha_action'];
 				$captcha_fields = $_SESSION['captcha_fields'];
 				$captcha_fields['captcha_response'] = preg_replace("/[^a-zA-Z0-9]+/", "", $_POST['captcha_response']);
@@ -110,7 +108,7 @@ class FacebookBridge extends BridgeAbstract {
 				$context = stream_context_create($http_options);
 				$html = getContents($captcha_action, false, $context);
 
-				if($html === false){
+				if($html === false) {
 					returnServerError('Failed to submit captcha response back to Facebook');
 				}
 				unset($_SESSION['captcha_fields']);
@@ -121,7 +119,7 @@ class FacebookBridge extends BridgeAbstract {
 		}
 
 		//Retrieve page contents
-		if(is_null($html)){
+		if(is_null($html)) {
 			$http_options = array(
 				'http' => array(
 					'method' => 'GET',
@@ -130,7 +128,7 @@ class FacebookBridge extends BridgeAbstract {
 				)
 			);
 			$context = stream_context_create($http_options);
-			if(!strpos($this->getInput('u'), "/")){
+			if(!strpos($this->getInput('u'), "/")) {
 				$html = getSimpleHTMLDOM(self::URI . urlencode($this->getInput('u')) . '?_fb_noscript=1',
 				false,
 				$context)
@@ -145,8 +143,7 @@ class FacebookBridge extends BridgeAbstract {
 
 		//Handle captcha form?
 		$captcha = $html->find('div.captcha_interstitial', 0);
-		if (!is_null($captcha))
-		{
+		if (!is_null($captcha)) {
 			//Save form for submitting after getting captcha response
 			if (session_status() == PHP_SESSION_NONE)
 				session_start();
@@ -182,7 +179,7 @@ EOD;
 		->next_sibling()
 		->children(0);
 
-		if(isset($element)){
+		if(isset($element)) {
 
 			$author = str_replace(' | Facebook', '', $html->find('title#pageTitle', 0)->innertext);
 			$profilePic = 'https://graph.facebook.com/'
@@ -191,17 +188,17 @@ EOD;
 
 			$this->authorName = $author;
 
-			foreach($element->children() as $cell){
+			foreach($element->children() as $cell) {
 				// Manage summary posts
-				if(strpos($cell->class, '_3xaf') !== false){
+				if(strpos($cell->class, '_3xaf') !== false) {
 					$posts = $cell->children();
 				} else {
 					$posts = array($cell);
 				}
 
-				foreach($posts as $post){
+				foreach($posts as $post) {
 					// Check media type
-					switch($this->getInput('media_type')){
+					switch($this->getInput('media_type')) {
 						case 'all': break;
 						case 'video':
 							if(empty($post->find('[aria-label=Video]'))) continue 2;
@@ -214,7 +211,7 @@ EOD;
 
 					$item = array();
 
-					if(count($post->find('abbr')) > 0){
+					if(count($post->find('abbr')) > 0) {
 
 						//Retrieve post contents
 						$content = preg_replace(
@@ -270,7 +267,7 @@ EOD;
 
 						//Retrieve date of the post
 						$date = $post->find("abbr")[0];
-						if(isset($date) && $date->hasAttribute('data-utime')){
+						if(isset($date) && $date->hasAttribute('data-utime')) {
 							$date = $date->getAttribute('data-utime');
 						} else {
 							$date = 0;
@@ -298,7 +295,7 @@ EOD;
 	}
 
 	public function getName(){
-		if(!empty($this->authorName)){
+		if(!empty($this->authorName)) {
 			return isset($this->extraInfos['name']) ? $this->extraInfos['name'] : $this->authorName
 			. ' - Facebook Bridge';
 		}
diff --git a/bridges/FeedExpanderExampleBridge.php b/bridges/FeedExpanderExampleBridge.php
index b855c2e3..9d2f1788 100644
--- a/bridges/FeedExpanderExampleBridge.php
+++ b/bridges/FeedExpanderExampleBridge.php
@@ -25,7 +25,7 @@ class FeedExpanderExampleBridge extends FeedExpander {
 	);
 
 	public function collectData(){
-		switch($this->getInput('version')){
+		switch($this->getInput('version')) {
 			case 'rss_0_9_1':
 				parent::collectExpandableDatas('http://static.userland.com/gems/backend/sampleRss.xml');
 				break;
@@ -43,7 +43,7 @@ class FeedExpanderExampleBridge extends FeedExpander {
 	}
 
 	protected function parseItem($newsItem) {
-		switch($this->getInput('version')){
+		switch($this->getInput('version')) {
 			case 'rss_0_9_1':
 				return $this->parseRSS_0_9_1_Item($newsItem);
 				break;
diff --git a/bridges/FierPandaBridge.php b/bridges/FierPandaBridge.php
index 13864715..cd9d11bd 100644
--- a/bridges/FierPandaBridge.php
+++ b/bridges/FierPandaBridge.php
@@ -11,7 +11,7 @@ class FierPandaBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM(self::URI)
 			or returnServerError('Could not request Fier Panda.');
 
-		foreach($html->find('div.container-content article') as $element){
+		foreach($html->find('div.container-content article') as $element) {
 			$item = array();
 			$item['uri'] = $this->getURI() . $element->find('a', 0)->href;
 			$item['title'] = trim($element->find('h1 a', 0)->innertext);
diff --git a/bridges/FilterBridge.php b/bridges/FilterBridge.php
index 00f045f8..e8b451c7 100644
--- a/bridges/FilterBridge.php
+++ b/bridges/FilterBridge.php
@@ -31,7 +31,7 @@ class FilterBridge extends FeedExpander {
 	protected function parseItem($newItem){
 		$item = parent::parseItem($newItem);
 
-		switch(true){
+		switch(true) {
 		case $this->getFilterType() === 'permit':
 			if (preg_match($this->getFilter(), $item['title'])) {
 				return $item;
@@ -57,20 +57,20 @@ class FilterBridge extends FeedExpander {
 	public function getURI(){
 		$url = $this->getInput('url');
 
-		if(empty($url)){
+		if(empty($url)) {
 			$url = parent::getURI();
 		}
 		return $url;
 	}
 
 	public function collectData(){
-		if($this->getInput('url') && substr($this->getInput('url'), 0, strlen('http')) !== 'http'){
+		if($this->getInput('url') && substr($this->getInput('url'), 0, strlen('http')) !== 'http') {
 			// just in case someone find a way to access local files by playing with the url
 			returnClientError('The url parameter must either refer to http or https protocol.');
 		}
 		try{
 			$this->collectExpandableDatas($this->getURI());
-		}catch (HttpException $e){
+		} catch (HttpException $e) {
 			$this->collectExpandableDatas($this->getURI());
 		}
 	}
diff --git a/bridges/FlickrBridge.php b/bridges/FlickrBridge.php
index 57f53a3c..f5ebe9cf 100644
--- a/bridges/FlickrBridge.php
+++ b/bridges/FlickrBridge.php
@@ -34,7 +34,7 @@ class FlickrBridge extends BridgeAbstract {
 	);
 
 	public function collectData(){
-		switch($this->queriedContext){
+		switch($this->queriedContext) {
 		case 'Explore':
 			$key = 'photos';
 			$html = getSimpleHTMLDOM(self::URI . 'explore')
@@ -68,7 +68,7 @@ class FlickrBridge extends BridgeAbstract {
 
 		$model_json = json_decode($model_text, true);
 
-		foreach($html->find('.photo-list-photo-view') as $element){
+		foreach($html->find('.photo-list-photo-view') as $element) {
 			// Get the styles
 			$style = explode(';', $element->style);
 
@@ -83,17 +83,17 @@ class FlickrBridge extends BridgeAbstract {
 			$imageID = reset($imageURIs);
 
 			// Use JSON data to build items
-			foreach(reset($model_json)[0][$key]['_data'] as $element){
-				if($element['id'] === $imageID){
+			foreach(reset($model_json)[0][$key]['_data'] as $element) {
+				if($element['id'] === $imageID) {
 					$item = array();
 
 					/* Author name depends on scope. On a keyword search the
 					 * author is part of the picture data. On a username search
 					 * the author is part of the owner data.
 					 */
-					if(array_key_exists('username', $element)){
+					if(array_key_exists('username', $element)) {
 						$item['author'] = $element['username'];
-					} elseif (array_key_exists('owner', reset($model_json)[0])){
+					} elseif (array_key_exists('owner', reset($model_json)[0])) {
 						$item['author'] = reset($model_json)[0]['owner']['username'];
 					}
 
diff --git a/bridges/FootitoBridge.php b/bridges/FootitoBridge.php
index 17cbda8d..ac06cd53 100644
--- a/bridges/FootitoBridge.php
+++ b/bridges/FootitoBridge.php
@@ -10,7 +10,7 @@ class FootitoBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM(self::URI)
 			or returnServerError('Could not request Footito.');
 
-		foreach($html->find('div.post') as $element){
+		foreach($html->find('div.post') as $element) {
 			$item = array();
 
 			$content = trim($element->innertext);
diff --git a/bridges/FourchanBridge.php b/bridges/FourchanBridge.php
index 5cfc6ea4..6aaa13e5 100644
--- a/bridges/FourchanBridge.php
+++ b/bridges/FourchanBridge.php
@@ -20,7 +20,7 @@ class FourchanBridge extends BridgeAbstract {
 	));
 
 	public function getURI(){
-		if(!is_null($this->getInput('c')) && !is_null($this->getInput('t'))){
+		if(!is_null($this->getInput('c')) && !is_null($this->getInput('t'))) {
 			return static::URI . $this->getInput('c') . '/thread/' . $this->getInput('t');
 		}
 
@@ -32,7 +32,7 @@ class FourchanBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM($this->getURI())
 			or returnServerError("Could not request 4chan, thread not found");
 
-		foreach($html->find('div.postContainer') as $element){
+		foreach($html->find('div.postContainer') as $element) {
 			$item = array();
 			$item['id'] = $element->find('.post', 0)->getAttribute('id');
 			$item['uri'] = $this->getURI() . '#' . $item['id'];
@@ -41,19 +41,19 @@ class FourchanBridge extends BridgeAbstract {
 
 			$file = $element->find('.file', 0);
 
-			if(!empty($file)){
+			if(!empty($file)) {
 				$item['image'] = $element->find('.file a', 0)->href;
 				$item['imageThumb'] = $element->find('.file img', 0)->src;
 				if(!isset($item['imageThumb']) and strpos($item['image'], '.swf') !== false)
 					$item['imageThumb'] = 'http://i.imgur.com/eO0cxf9.jpg';
 			}
 
-			if(!empty($element->find('span.subject', 0)->innertext)){
+			if(!empty($element->find('span.subject', 0)->innertext)) {
 				$item['subject'] = $element->find('span.subject', 0)->innertext;
 			}
 
 			$item['title'] = 'reply ' . $item['id'] . ' | ' . $item['author'];
-				if(isset($item['subject'])){
+				if(isset($item['subject'])) {
 					$item['title'] = $item['subject'] . ' - ' . $item['title'];
 				}
 
@@ -61,7 +61,7 @@ class FourchanBridge extends BridgeAbstract {
 			$content = str_replace('href="#p', 'href="' . $this->getURI() . '#p', $content);
 			$item['content'] = '<span id="' . $item['id'] . '">' . $content . '</span>';
 
-			if(isset($item['image'])){
+			if(isset($item['image'])) {
 				$item['content'] = '<a href="'
 				. $item['image']
 				. '"><img alt="'
diff --git a/bridges/FuturaSciencesBridge.php b/bridges/FuturaSciencesBridge.php
index e41e5185..b9479c3d 100644
--- a/bridges/FuturaSciencesBridge.php
+++ b/bridges/FuturaSciencesBridge.php
@@ -95,7 +95,7 @@ class FuturaSciencesBridge extends FeedExpander {
 	}
 
 	private function stripWithDelimiters($string, $start, $end){
-		while(strpos($string, $start) !== false){
+		while(strpos($string, $start) !== false) {
 			$section_to_remove = substr($string, strpos($string, $start));
 			$section_to_remove = substr($section_to_remove, 0, strpos($section_to_remove, $end) + strlen($end));
 			$string = str_replace($section_to_remove, '', $string);
@@ -106,8 +106,8 @@ class FuturaSciencesBridge extends FeedExpander {
 		$open_tag = '<' . $tag_name;
 		$close_tag = '</' . $tag_name . '>';
 		$close_tag_length = strlen($close_tag);
-		if(strpos($tag_start, $open_tag) === 0){
-			while(strpos($string, $tag_start) !== false){
+		if(strpos($tag_start, $open_tag) === 0) {
+			while(strpos($string, $tag_start) !== false) {
 				$max_recursion = 100;
 				$section_to_remove = null;
 				$section_start = strpos($string, $tag_start);
@@ -165,7 +165,7 @@ class FuturaSciencesBridge extends FeedExpander {
 	// Extracts the author from an article or element
 	private function extractAuthor($article){
 		$article_author = $article->find('h3.epsilon', 0);
-		if($article_author){
+		if($article_author) {
 			return trim(str_replace(', Futura-Sciences', '', $article_author->plaintext));
 		}
 		return '';
diff --git a/bridges/GBAtempBridge.php b/bridges/GBAtempBridge.php
index b8565139..f80a25ce 100644
--- a/bridges/GBAtempBridge.php
+++ b/bridges/GBAtempBridge.php
@@ -21,7 +21,7 @@ class GBAtempBridge extends BridgeAbstract {
 	));
 
 	private 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;
@@ -31,7 +31,7 @@ class GBAtempBridge extends BridgeAbstract {
 	}
 
 	private function stripWithDelimiters($string, $start, $end){
-		while(strpos($string, $start) !== false){
+		while(strpos($string, $start) !== false) {
 			$section_to_remove = substr($string, strpos($string, $start));
 			$section_to_remove = substr($section_to_remove, 0, strpos($section_to_remove, $end) + strlen($end));
 			$string = str_replace($section_to_remove, '', $string);
@@ -59,7 +59,7 @@ class GBAtempBridge extends BridgeAbstract {
 
 	private function fetchPostContent($uri, $site_url){
 		$html = getSimpleHTMLDOM($uri);
-		if(!$html){
+		if(!$html) {
 			return 'Could not request GBAtemp ' . $uri;
 		}
 
@@ -72,9 +72,9 @@ class GBAtempBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM(self::URI)
 			or returnServerError('Could not request GBAtemp.');
 
-		switch($this->getInput('type')){
+		switch($this->getInput('type')) {
 		case 'N':
-			foreach($html->find('li[class=news_item full]') as $newsItem){
+			foreach($html->find('li[class=news_item full]') as $newsItem) {
 				$url = self::URI . $newsItem->find('a', 0)->href;
 				$time = intval(
 					$this->extractFromDelimiters(
@@ -89,7 +89,7 @@ class GBAtempBridge extends BridgeAbstract {
 				$this->items[] = $this->buildItem($url, $title, $author, $time, $content);
 			}
 		case 'R':
-			foreach($html->find('li.portal_review') as $reviewItem){
+			foreach($html->find('li.portal_review') as $reviewItem) {
 				$url = self::URI . $reviewItem->find('a', 0)->href;
 				$title = $reviewItem->find('span.review_title', 0)->plaintext;
 				$content = getSimpleHTMLDOM($url)
@@ -111,7 +111,7 @@ class GBAtempBridge extends BridgeAbstract {
 				$this->items[] = $this->buildItem($url, $title, $author, $time, $content);
 			}
 		case 'T':
-			foreach($html->find('li.portal-tutorial') as $tutorialItem){
+			foreach($html->find('li.portal-tutorial') as $tutorialItem) {
 				$url = self::URI . $tutorialItem->find('a', 0)->href;
 				$title = $tutorialItem->find('a', 0)->plaintext;
 				$time = intval(
@@ -126,7 +126,7 @@ class GBAtempBridge extends BridgeAbstract {
 				$this->items[] = $this->buildItem($url, $title, $author, $time, $content);
 			}
 		case 'F':
-			foreach($html->find('li.rc_item') as $postItem){
+			foreach($html->find('li.rc_item') as $postItem) {
 				$url = self::URI . $postItem->find('a', 1)->href;
 				$title = $postItem->find('a', 1)->plaintext;
 				$time = intval(
@@ -144,7 +144,7 @@ class GBAtempBridge extends BridgeAbstract {
 	}
 
 	public function getName() {
-		if(!is_null($this->getInput('type'))){
+		if(!is_null($this->getInput('type'))) {
 			$type = array_search(
 				$this->getInput('type'),
 				self::PARAMETERS[$this->queriedContext]['type']['values']
diff --git a/bridges/GiphyBridge.php b/bridges/GiphyBridge.php
index e8b0dc1b..26d1ebaf 100644
--- a/bridges/GiphyBridge.php
+++ b/bridges/GiphyBridge.php
@@ -27,14 +27,14 @@ class GiphyBridge extends BridgeAbstract {
 			or returnServerError('No results for this query.');
 
 		$max = GIPHY_LIMIT;
-		if($this->getInput('n')){
+		if($this->getInput('n')) {
 			$max = $this->getInput('n');
 		}
 
 		$limit = 0;
 		$kw = urlencode($this->getInput('s'));
-		foreach($html->find('div.hoverable-gif') as $entry){
-			if($limit < $max){
+		foreach($html->find('div.hoverable-gif') as $entry) {
+			if($limit < $max) {
 				$node = $entry->first_child();
 				$href = $node->getAttribute('href');
 
@@ -54,7 +54,7 @@ class GiphyBridge extends BridgeAbstract {
 					$title = str_replace($kw, '', $title);
 					$title = preg_replace('/\s+/', ' ', $title);
 					$title = trim($title);
-					if(strlen($title) <= 0){
+					if(strlen($title) <= 0) {
 						$title = $item['id'];
 					}
 				$item['title'] = trim($title);
diff --git a/bridges/GithubIssueBridge.php b/bridges/GithubIssueBridge.php
index d008f073..4f121d8a 100644
--- a/bridges/GithubIssueBridge.php
+++ b/bridges/GithubIssueBridge.php
@@ -35,9 +35,9 @@ class GithubIssueBridge extends BridgeAbstract {
 
 	public function getName(){
 		$name = $this->getInput('u') . '/' . $this->getInput('p');
-		switch($this->queriedContext){
+		switch($this->queriedContext) {
 		case 'Project Issues':
-			if($this->getInput('c')){
+			if($this->getInput('c')) {
 				$prefix = static::NAME . 's comments for ';
 			} else {
 				$prefix = static::NAME . 's for ';
@@ -53,11 +53,11 @@ class GithubIssueBridge extends BridgeAbstract {
 	}
 
 	public function getURI(){
-		if(!is_null($this->getInput('u')) && !is_null($this->getInput('p'))){
+		if(!is_null($this->getInput('u')) && !is_null($this->getInput('p'))) {
 			$uri = static::URI . $this->getInput('u') . '/' . $this->getInput('p') . '/issues';
-			if($this->queriedContext === 'Issue comments'){
+			if($this->queriedContext === 'Issue comments') {
 				$uri .= '/' . $this->getInput('i');
-			} elseif($this->getInput('c')){
+			} elseif($this->getInput('c')) {
 				$uri .= '?q=is%3Aissue+sort%3Aupdated-desc';
 			}
 			return $uri;
@@ -70,29 +70,29 @@ class GithubIssueBridge extends BridgeAbstract {
 		$class = $comment->getAttribute('class');
 		$classes = explode(' ', $class);
 		$event = false;
-		if(in_array('discussion-item', $classes)){
+		if(in_array('discussion-item', $classes)) {
 			$event = true;
 		}
 
 		$author = 'unknown';
-		if($comment->find('.author', 0)){
+		if($comment->find('.author', 0)) {
 			$author = $comment->find('.author', 0)->plaintext;
 		}
 
 		$uri = static::URI . $this->getInput('u') . '/' . $this->getInput('p') . '/issues/' . $issueNbr;
 
 		$comment = $comment->firstChild();
-		if(!$event){
+		if(!$event) {
 			$comment = $comment->nextSibling();
 		}
 
-		if($event){
+		if($event) {
 			$title .= ' / ' . substr($class, strpos($class, 'discussion-item-') + strlen('discussion-item-'));
-			if(!$comment->hasAttribute('id')){
+			if(!$comment->hasAttribute('id')) {
 				$items = array();
 				$timestamp = strtotime($comment->find('relative-time', 0)->getAttribute('datetime'));
 				$content = $comment->innertext;
-				while($comment = $comment->nextSibling()){
+				while($comment = $comment->nextSibling()) {
 					$item = array();
 					$item['author'] = $author;
 					$item['title'] = html_entity_decode($title, ENT_QUOTES, 'UTF-8');
@@ -123,12 +123,12 @@ class GithubIssueBridge extends BridgeAbstract {
 		$title = $issue->find('.gh-header-title', 0)->plaintext;
 		$issueNbr = trim(substr($issue->find('.gh-header-number', 0)->plaintext, 1));
 		$comments = $issue->find('.js-discussion', 0);
-		foreach($comments->children() as $comment){
+		foreach($comments->children() as $comment) {
 			$classes = explode(' ', $comment->getAttribute('class'));
 			if(in_array('discussion-item', $classes)
-			|| in_array('timeline-comment-wrapper', $classes)){
+			|| in_array('timeline-comment-wrapper', $classes)) {
 				$item = $this->extractIssueComment($issueNbr, $title, $comment);
-				if(array_keys($item) !== range(0, count($item) - 1)){
+				if(array_keys($item) !== range(0, count($item) - 1)) {
 					$item = array($item);
 				}
 				$items = array_merge($items, $item);
@@ -141,22 +141,22 @@ class GithubIssueBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM($this->getURI())
 			or returnServerError('No results for Github Issue ' . $this->getURI());
 
-		switch($this->queriedContext){
+		switch($this->queriedContext) {
 		case 'Issue comments':
 			$this->items = $this->extractIssueComments($html);
 			break;
 		case 'Project Issues':
-			foreach($html->find('.js-active-navigation-container .js-navigation-item') as $issue){
+			foreach($html->find('.js-active-navigation-container .js-navigation-item') as $issue) {
 				$info = $issue->find('.opened-by', 0);
 				$issueNbr = substr(trim($info->plaintext), 1, strpos(trim($info->plaintext), ' '));
 
 				$item = array();
 				$item['content'] = '';
 
-				if($this->getInput('c')){
+				if($this->getInput('c')) {
 					$uri = static::URI . $this->getInput('u') . '/' . $this->getInput('p') . '/issues/' . $issueNbr;
 					$issue = getSimpleHTMLDOMCached($uri, static::CACHE_TIMEOUT);
-					if($issue){
+					if($issue) {
 						$this->items = array_merge($this->items, $this->extractIssueComments($issue));
 						continue;
 					}
diff --git a/bridges/GithubSearchBridge.php b/bridges/GithubSearchBridge.php
index 3763ee81..d3a615b5 100644
--- a/bridges/GithubSearchBridge.php
+++ b/bridges/GithubSearchBridge.php
@@ -24,7 +24,7 @@ class GithubSearchBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM($url)
 			or returnServerError('Error while downloading the website content');
 
-		foreach($html->find('div.repo-list-item') as $element){
+		foreach($html->find('div.repo-list-item') as $element) {
 			$item = array();
 
 			$uri = $element->find('h3 a', 0)->href;
@@ -34,10 +34,9 @@ class GithubSearchBridge extends BridgeAbstract {
 			$title = $element->find('h3', 0)->plaintext;
 			$item['title'] = $title;
 
-			if (count($element->find('p')) == 2){
+			if (count($element->find('p')) == 2) {
 				$content = $element->find('p', 0)->innertext;
-			}
-			else{
+			} else{
 				$content = '';
 			}
 			$item['content'] = $content;
diff --git a/bridges/GizmodoBridge.php b/bridges/GizmodoBridge.php
index c98f7550..35f162b8 100644
--- a/bridges/GizmodoBridge.php
+++ b/bridges/GizmodoBridge.php
@@ -11,11 +11,11 @@ class GizmodoBridge extends FeedExpander {
 		$item = parent::parseItem($item);
 
 		$articleHTMLContent = getSimpleHTMLDOMCached($item['uri']);
-		if(!$articleHTMLContent){
+		if(!$articleHTMLContent) {
 			$text = 'Could not load ' . $item['uri'];
 		} else {
 			$text = $articleHTMLContent->find('div.entry-content', 0)->innertext;
-			foreach($articleHTMLContent->find('pagespeed_iframe') as $element){
+			foreach($articleHTMLContent->find('pagespeed_iframe') as $element) {
 				$text .= '<p>link to a iframe (could be a video): <a href="'
 				. $element->src
 				. '">'
diff --git a/bridges/GoComicsBridge.php b/bridges/GoComicsBridge.php
index d4a6be21..27621d8a 100644
--- a/bridges/GoComicsBridge.php
+++ b/bridges/GoComicsBridge.php
@@ -18,7 +18,7 @@ class GoComicsBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM($this->getURI())
 			or returnServerError('Could not request GoComics: ' . $this->getURI());
 
-		foreach($html->find('div.item-comic-container') as $element){
+		foreach($html->find('div.item-comic-container') as $element) {
 
 			$img = $element->find('img', 0);
 			$link = $element->find('a.item-comic-link', 0);
@@ -42,7 +42,7 @@ class GoComicsBridge extends BridgeAbstract {
 	}
 
 	public function getURI(){
-		if(!is_null($this->getInput('comicname'))){
+		if(!is_null($this->getInput('comicname'))) {
 			return self::URI . urlencode($this->getInput('comicname'));
 		}
 
@@ -50,7 +50,7 @@ class GoComicsBridge extends BridgeAbstract {
 	}
 
 	public function getName(){
-		if(!is_null($this->getInput('comicname'))){
+		if(!is_null($this->getInput('comicname'))) {
 			return $this->getInput('comicname') . ' - GoComics';
 		}
 
diff --git a/bridges/GooglePlusPostBridge.php b/bridges/GooglePlusPostBridge.php
index 69b6a0c0..0fccc96a 100644
--- a/bridges/GooglePlusPostBridge.php
+++ b/bridges/GooglePlusPostBridge.php
@@ -21,7 +21,7 @@ class GooglePlusPostBridge extends BridgeAbstract{
 		$username = $this->getInput('username');
 
 		// Usernames start with a + if it's not an ID
-		if(!is_numeric($username) && substr($username, 0, 1) !== '+'){
+		if(!is_numeric($username) && substr($username, 0, 1) !== '+') {
 			$username = '+' . $username;
 		}
 
@@ -34,7 +34,7 @@ class GooglePlusPostBridge extends BridgeAbstract{
 		$this->_url = $html->find('meta[property=og:url]', 0)->getAttribute('content');
 
 		// I don't even know where to start with this discusting html...
-		foreach($html->find('div[jsname=WsjYwc]') as $post){
+		foreach($html->find('div[jsname=WsjYwc]') as $post) {
 			$item = array();
 
 			$item['author'] = $item['fullname'] = $post->find('div div div div a', 0)->innertext;
@@ -44,7 +44,7 @@ class GooglePlusPostBridge extends BridgeAbstract{
 
 			$timestamp = $post->find('a.qXj2He span', 0);
 
-			if($timestamp){
+			if($timestamp) {
 				$item['timestamp'] = strtotime('+' . preg_replace(
 						'/[^0-9A-Za-z]/',
 						'',
@@ -77,15 +77,15 @@ class GooglePlusPostBridge extends BridgeAbstract{
 
 			// XXX ugly but I don't have any idea how to do a better stuff,
 			// str_replace on link doesn't work as expected and ask too many checks
-			foreach($content->find('a') as $link){
+			foreach($content->find('a') as $link) {
 				$hasHttp = strpos($link->href, 'http');
 				$hasDoubleSlash = strpos($link->href, '//');
 
 				if((!$hasHttp && !$hasDoubleSlash)
 				|| (false !== $hasHttp && strpos($link->href, 'http') != 0)
-				|| (false === $hasHttp && false !== $hasDoubleSlash && $hasDoubleSlash != 0)){
+				|| (false === $hasHttp && false !== $hasDoubleSlash && $hasDoubleSlash != 0)) {
 					// skipp bad link, for some hashtag or other stuff
-					if(strpos($link->href, '/') == 0){
+					if(strpos($link->href, '/') == 0) {
 						$link->href = substr($link->href, 1);
 					}
 
diff --git a/bridges/GoogleSearchBridge.php b/bridges/GoogleSearchBridge.php
index 67e14dc4..2c4a5f1b 100644
--- a/bridges/GoogleSearchBridge.php
+++ b/bridges/GoogleSearchBridge.php
@@ -33,8 +33,8 @@ class GoogleSearchBridge extends BridgeAbstract {
 
 		$emIsRes = $html->find('div[id=ires]', 0);
 
-		if(!is_null($emIsRes)){
-			foreach($emIsRes->find('div[class=g]') as $element){
+		if(!is_null($emIsRes)) {
+			foreach($emIsRes->find('div[class=g]') as $element) {
 
 				$item = array();
 
@@ -42,7 +42,7 @@ class GoogleSearchBridge extends BridgeAbstract {
 				$t = $element->find('a[href]', 0)->href;
 				$item['uri'] = '' . $t;
 				parse_str(parse_url($t, PHP_URL_QUERY), $parameters);
-				if(isset($parameters['q'])){
+				if(isset($parameters['q'])) {
 					$item['uri'] = $parameters['q'];
 				}
 
@@ -55,7 +55,7 @@ class GoogleSearchBridge extends BridgeAbstract {
 	}
 
 	public function getName(){
-		if(!is_null($this->getInput('q'))){
+		if(!is_null($this->getInput('q'))) {
 			return $this->getInput('q') . ' - Google search';
 		}
 
diff --git a/bridges/HDWallpapersBridge.php b/bridges/HDWallpapersBridge.php
index 29f9c00c..cea6e344 100644
--- a/bridges/HDWallpapersBridge.php
+++ b/bridges/HDWallpapersBridge.php
@@ -23,7 +23,7 @@ class HDWallpapersBridge extends BridgeAbstract {
 
 	public function collectData(){
 		$category = $this->category;
-		if(strrpos($category, 'wallpapers') !== strlen($category) - strlen('wallpapers')){
+		if(strrpos($category, 'wallpapers') !== strlen($category) - strlen('wallpapers')) {
 			$category .= '-desktop-wallpapers';
 		}
 
@@ -31,17 +31,17 @@ class HDWallpapersBridge extends BridgeAbstract {
 		$max = $this->getInput('m') ?: 14;
 		$lastpage = 1;
 
-		for($page = 1; $page <= $lastpage; $page++){
+		for($page = 1; $page <= $lastpage; $page++) {
 			$link = self::URI . '/' . $category . '/page/' . $page;
 			$html = getSimpleHTMLDOM($link)
 				or returnServerError('No results for this query.');
 
-			if($page === 1){
+			if($page === 1) {
 				preg_match('/page\/(\d+)$/', $html->find('.pagination a', -2)->href, $matches);
 				$lastpage = min($matches[1], ceil($max / 14));
 			}
 
-			foreach($html->find('.wallpapers .wall a') as $element){
+			foreach($html->find('.wallpapers .wall a') as $element) {
 				$thumbnail = $element->find('img', 0);
 
 				$item = array();
@@ -70,7 +70,7 @@ class HDWallpapersBridge extends BridgeAbstract {
 	}
 
 	public function getName(){
-		if(!is_null($this->getInput('c')) && !is_null($this->getInput('r'))){
+		if(!is_null($this->getInput('c')) && !is_null($this->getInput('r'))) {
 			return 'HDWallpapers - '
 			. str_replace(['__', '_'], [' & ', ' '], $this->getInput('c'))
 			. ' ['
diff --git a/bridges/HentaiHavenBridge.php b/bridges/HentaiHavenBridge.php
index 14f4ee57..21a0ff5e 100644
--- a/bridges/HentaiHavenBridge.php
+++ b/bridges/HentaiHavenBridge.php
@@ -11,7 +11,7 @@ class HentaiHavenBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM(self::URI)
 			or returnServerError('Could not request Hentai Haven.');
 
-		foreach($html->find('div.zoe-grid') as $element){
+		foreach($html->find('div.zoe-grid') as $element) {
 			$item = array();
 			$item['uri'] = $element->find('div.brick-content h3 a', 0)->href;
 			$thumbnailUri = $element->find('a.thumbnail-image img', 0)->getAttribute('data-src');
diff --git a/bridges/IdenticaBridge.php b/bridges/IdenticaBridge.php
index 826ff5b9..ef52998f 100644
--- a/bridges/IdenticaBridge.php
+++ b/bridges/IdenticaBridge.php
@@ -18,7 +18,7 @@ class IdenticaBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM($this->getURI())
 			or returnServerError('Requested username can\'t be found.');
 
-		foreach($html->find('li.major') as $dent){
+		foreach($html->find('li.major') as $dent) {
 			$item = array();
 
 			// get dent link
@@ -35,7 +35,7 @@ class IdenticaBridge extends BridgeAbstract {
 	}
 
 	public function getName(){
-		if(!is_null($this->getInput('u'))){
+		if(!is_null($this->getInput('u'))) {
 			return $this->getInput('u') . ' - Identica Bridge';
 		}
 
@@ -43,7 +43,7 @@ class IdenticaBridge extends BridgeAbstract {
 	}
 
 	public function getURI(){
-		if(!is_null($this->getInput('u'))){
+		if(!is_null($this->getInput('u'))) {
 			return self::URI . urlencode($this->getInput('u'));
 		}
 
diff --git a/bridges/InstagramBridge.php b/bridges/InstagramBridge.php
index 4df5a799..7ae6a45f 100644
--- a/bridges/InstagramBridge.php
+++ b/bridges/InstagramBridge.php
@@ -30,13 +30,13 @@ class InstagramBridge extends BridgeAbstract {
 
 		$innertext = null;
 
-		foreach($html->find('script') as $script){
-			if('' === $script->innertext){
+		foreach($html->find('script') as $script) {
+			if('' === $script->innertext) {
 				continue;
 			}
 
 			$pos = strpos(trim($script->innertext), 'window._sharedData');
-			if(0 !== $pos){
+			if(0 !== $pos) {
 				continue;
 			}
 
@@ -49,9 +49,9 @@ class InstagramBridge extends BridgeAbstract {
 
 		$userMedia = $data->entry_data->ProfilePage[0]->user->media->nodes;
 
-		foreach($userMedia as $media){
+		foreach($userMedia as $media) {
 			// Check media type
-			switch($this->getInput('media_type')){
+			switch($this->getInput('media_type')) {
 				case 'all': break;
 				case 'video':
 					if($media->is_video === false) continue 2;
@@ -65,7 +65,7 @@ class InstagramBridge extends BridgeAbstract {
 			$item = array();
 			$item['uri'] = self::URI . 'p/' . $media->code . '/';
 			$item['content'] = '<img src="' . htmlentities($media->display_src) . '" />';
-			if (isset($media->caption)){
+			if (isset($media->caption)) {
 				$item['title'] = $media->caption;
 			} else {
 				$item['title'] = basename($media->display_src);
@@ -76,7 +76,7 @@ class InstagramBridge extends BridgeAbstract {
 	}
 
 	public function getName(){
-		if(!is_null($this->getInput('u'))){
+		if(!is_null($this->getInput('u'))) {
 			return $this->getInput('u') . ' - Instagram Bridge';
 		}
 
@@ -84,7 +84,7 @@ class InstagramBridge extends BridgeAbstract {
 	}
 
 	public function getURI(){
-		if(!is_null($this->getInput('u'))){
+		if(!is_null($this->getInput('u'))) {
 			return self::URI . urlencode($this->getInput('u'));
 		}
 
diff --git a/bridges/IsoHuntBridge.php b/bridges/IsoHuntBridge.php
index a465bdd0..57038fcc 100644
--- a/bridges/IsoHuntBridge.php
+++ b/bridges/IsoHuntBridge.php
@@ -92,9 +92,9 @@ class IsoHuntBridge extends BridgeAbstract {
 
 	public function getURI(){
 		$uri = self::URI;
-		switch($this->queriedContext){
+		switch($this->queriedContext) {
 		case 'By "Latest" category':
-			switch($this->getInput('latest_category')){
+			switch($this->getInput('latest_category')) {
 			case 'hot_torrents':
 				$uri .= 'statistic/hot/torrents';
 				break;
@@ -128,7 +128,7 @@ class IsoHuntBridge extends BridgeAbstract {
 	}
 
 	public function getName(){
-		switch($this->queriedContext){
+		switch($this->queriedContext) {
 		case 'By "Latest" category':
 			$categoryName = array_search(
 					$this->getInput('latest_category'),
@@ -163,9 +163,9 @@ class IsoHuntBridge extends BridgeAbstract {
 	public function collectData(){
 		$html = $this->loadHtml($this->getURI());
 
-		switch($this->queriedContext){
+		switch($this->queriedContext) {
 		case 'By "Latest" category':
-			switch($this->getInput('latest_category')){
+			switch($this->getInput('latest_category')) {
 			case 'hot_torrents':
 				$this->getLatestHotTorrents($html);
 				break;
@@ -179,7 +179,7 @@ class IsoHuntBridge extends BridgeAbstract {
 			}
 			break;
 		case 'By "Torrent" category':
-			if($this->getInput('torrent_category') === 'movies'){
+			if($this->getInput('torrent_category') === 'movies') {
 				// This one is special (content wise)
 				$this->getMovieTorrents($html);
 			} else {
@@ -187,7 +187,7 @@ class IsoHuntBridge extends BridgeAbstract {
 			}
 			break;
 		case 'Search torrent by name':
-			if( $this->getInput('search_category') === 'movies'){
+			if($this->getInput('search_category') === 'movies') {
 				// This one is special (content wise)
 				$this->getMovieTorrents($html);
 			} else {
@@ -208,7 +208,7 @@ class IsoHuntBridge extends BridgeAbstract {
 		if(!$torrents)
 			returnServerError('Unable to find torrents!');
 
-		foreach($torrents as $torrent){
+		foreach($torrents as $torrent) {
 
 			$anchor = $torrent->find('a', 0);
 			if(!$anchor)
@@ -246,7 +246,7 @@ class IsoHuntBridge extends BridgeAbstract {
 		// Remove first element (header row)
 		$torrents = array_slice($torrents, 1);
 
-		foreach($torrents as $torrent){
+		foreach($torrents as $torrent) {
 
 			$cell = $torrent->find('td', 0);
 			if(!$cell)
@@ -281,7 +281,7 @@ class IsoHuntBridge extends BridgeAbstract {
 		if(!$posts)
 			returnServerError('Unable to find posts!');
 
-		foreach($posts as $post){
+		foreach($posts as $post) {
 			$item = array();
 
 			$item['uri'] = $this->latestNewsExtractUri($post);
@@ -316,7 +316,7 @@ class IsoHuntBridge extends BridgeAbstract {
 		$timestamp = strtotime($matches[1]);
 
 		// Make sure date is not in the future (dates are given like 'Nov. 20' without year)
-		if($timestamp > time()){
+		if($timestamp > time()) {
 			$timestamp = strtotime('-1 year', $timestamp);
 		}
 
@@ -345,12 +345,12 @@ class IsoHuntBridge extends BridgeAbstract {
 			returnServerError('Unable to find content!');
 
 		// Remove <h2>...</h2> (title)
-		foreach($content->find('h2') as $element){
+		foreach($content->find('h2') as $element) {
 			$element->outertext = '';
 		}
 
 		// Remove <small>...</small> (author)
-		foreach($content->find('small') as $element){
+		foreach($content->find('small') as $element) {
 			$element->outertext = '';
 		}
 
@@ -370,7 +370,7 @@ class IsoHuntBridge extends BridgeAbstract {
 		if(!$torrents)
 			returnServerError('Unable to find torrents!');
 
-		foreach($torrents as $torrent){
+		foreach($torrents as $torrent) {
 			$item = array();
 
 			$item['uri'] = $this->latestTorrentsExtractUri($torrent);
@@ -444,7 +444,7 @@ class IsoHuntBridge extends BridgeAbstract {
 	}
 
 	private function buildCategoryUri($category, $order_popularity = false){
-		switch($category){
+		switch($category) {
 		case 'anime': $index = 1; break;
 		case 'software' : $index = 2; break;
 		case 'games' : $index = 3; break;
diff --git a/bridges/JapanExpoBridge.php b/bridges/JapanExpoBridge.php
index 040754cd..c80bb24c 100644
--- a/bridges/JapanExpoBridge.php
+++ b/bridges/JapanExpoBridge.php
@@ -38,7 +38,7 @@ class JapanExpoBridge extends BridgeAbstract {
 		}
 
 		$convert_article_images = function($matches){
-			if(is_array($matches) && count($matches) > 1){
+			if(is_array($matches) && count($matches) > 1) {
 				return '<img src="' . $matches[1] . '" />';
 			}
 		};
@@ -48,7 +48,7 @@ class JapanExpoBridge extends BridgeAbstract {
 		$fullcontent = $this->getInput('mode');
 		$count = 0;
 
-		foreach($html->find('a._tile2') as $element){
+		foreach($html->find('a._tile2') as $element) {
 
 			$url = $element->href;
 			$thumbnail = 'http://s.japan-expo.com/katana/images/JES049/paris.png';
@@ -57,8 +57,8 @@ class JapanExpoBridge extends BridgeAbstract {
 			if(count($img_search_result) >= 2)
 				$thumbnail = trim($img_search_result[1], "'");
 
-			if($fullcontent){
-				if($count >= 5){
+			if($fullcontent) {
+				if($count >= 5) {
 					break;
 				}
 
diff --git a/bridges/KATBridge.php b/bridges/KATBridge.php
index 86d7f16e..c4325a60 100644
--- a/bridges/KATBridge.php
+++ b/bridges/KATBridge.php
@@ -49,23 +49,22 @@ class KATBridge extends BridgeAbstract {
 				return $timestamp;
 		}
 		$catBool = $this->getInput('cat_check');
-		if($catBool){
+		if($catBool) {
 			$catNum = $this->getInput('cat');
 		}
 		$critList = $this->getInput('crit');
 		$trustedBool = $this->getInput('trusted');
 		$keywordsList = explode(';', $this->getInput('q'));
-		foreach($keywordsList as $keywords){
-			switch($critList){
+		foreach($keywordsList as $keywords) {
+			switch($critList) {
 			case 'search':
-				if($catBool == false){
+				if($catBool == false) {
 					$html = getSimpleHTMLDOM(
 						self::URI .
 						'torrents-search.php?search=' .
 						rawurlencode($keywords)
 					) or returnServerError('Could not request KAT.');
-				}
-				else {
+				} else {
 					$html = getSimpleHTMLDOM(
 						self::URI .
 						'torrents-search.php?search=' .
@@ -92,10 +91,10 @@ class KATBridge extends BridgeAbstract {
 			}
 			if ($html->find('table.ttable_headinner', 0) == false)
 				returnServerError('No result for query ' . $keywords);
-			foreach($html->find('tr.t-row') as $element){
+			foreach($html->find('tr.t-row') as $element) {
 				if(!$trustedBool
 				|| !is_null($element->find('i[title="Elite Uploader"]', 0))
-				|| !is_null($element->find('i[title="Verified Uploader"]', 0))){
+				|| !is_null($element->find('i[title="Verified Uploader"]', 0))) {
 					$item = array();
 					$item['uri'] = self::URI . $element->find('a', 2)->href;
 					$item['id'] = self::URI . $element->find('a.cellMainLink', 0)->href;
diff --git a/bridges/KernelBugTrackerBridge.php b/bridges/KernelBugTrackerBridge.php
index 6494a218..567ee50c 100644
--- a/bridges/KernelBugTrackerBridge.php
+++ b/bridges/KernelBugTrackerBridge.php
@@ -66,18 +66,18 @@ class KernelBugTrackerBridge extends BridgeAbstract {
 		// Get and limit comments
 		$comments = $html->find('div.bz_comment');
 
-		if($limit > 0 && count($comments) > $limit){
+		if($limit > 0 && count($comments) > $limit) {
 			$comments = array_slice($comments, count($comments) - $limit, $limit);
 		}
 
 		// Order comments
-		switch($sorting){
+		switch($sorting) {
 			case 'lf': $comments = array_reverse($comments, true);
 			case 'of':
 			default: // Nothing to do, keep original order
 		}
 
-		foreach($comments as $comment){
+		foreach($comments as $comment) {
 			$comment = $this->inlineStyles($comment);
 
 			$item = array();
@@ -99,7 +99,7 @@ class KernelBugTrackerBridge extends BridgeAbstract {
 	}
 
 	public function getURI(){
-		switch($this->queriedContext){
+		switch($this->queriedContext) {
 			case 'Bug comments':
 				return parent::getURI()
 				. '/show_bug.cgi?id='
@@ -110,7 +110,7 @@ class KernelBugTrackerBridge extends BridgeAbstract {
 	}
 
 	public function getName(){
-		switch($this->queriedContext){
+		switch($this->queriedContext) {
 			case 'Bug comments':
 				return 'Bug '
 				. $this->bugid
@@ -142,7 +142,7 @@ class KernelBugTrackerBridge extends BridgeAbstract {
 	 * attributes.
 	 */
 	private function inlineStyles($html){
-		foreach($html->find('.bz_obsolete') as $element){
+		foreach($html->find('.bz_obsolete') as $element) {
 			$element->style = 'text-decoration:line-through;';
 		}
 
diff --git a/bridges/KununuBridge.php b/bridges/KununuBridge.php
index ad3fdea4..e99e1350 100644
--- a/bridges/KununuBridge.php
+++ b/bridges/KununuBridge.php
@@ -41,13 +41,13 @@ class KununuBridge extends BridgeAbstract {
 	private $companyName = '';
 
 	public function getURI(){
-		if(!is_null($this->getInput('company')) && !is_null($this->getInput('site'))){
+		if(!is_null($this->getInput('company')) && !is_null($this->getInput('site'))) {
 
 			$company = $this->fixCompanyName($this->getInput('company'));
 			$site = $this->getInput('site');
 			$section = '';
 
-			switch($site){
+			switch($site) {
 			case 'at':
 			case 'de':
 			case 'ch':
@@ -65,7 +65,7 @@ class KununuBridge extends BridgeAbstract {
 	}
 
 	function getName(){
-		if(!is_null($this->getInput('company'))){
+		if(!is_null($this->getInput('company'))) {
 			$company = $this->fixCompanyName($this->getInput('company'));
 			return ($this->companyName ?: $company) . ' - ' . self::NAME;
 		}
@@ -94,7 +94,7 @@ class KununuBridge extends BridgeAbstract {
 			returnServerError('Unable to find articles!');
 
 		// Go through all articles
-		foreach($articles as $article){
+		foreach($articles as $article) {
 			$item = array();
 
 			$item['author'] = $this->extractArticleAuthorPosition($article);
@@ -208,8 +208,8 @@ class KununuBridge extends BridgeAbstract {
 
 		// Go through all h2 elements to find index of required span (I know... it's stupid)
 		$author_position = 'Unknown';
-		foreach($user_content->find('div') as $content){
-			if(stristr(strtolower($content->plaintext), 'position')){ /* This works for at, ch, de, us */
+		foreach($user_content->find('div') as $content) {
+			if(stristr(strtolower($content->plaintext), 'position')) { /* This works for at, ch, de, us */
 				$author_position = $content->next_sibling()->plaintext;
 				break;
 			}
diff --git a/bridges/LWNprevBridge.php b/bridges/LWNprevBridge.php
index 78ef3ede..dc06a6db 100644
--- a/bridges/LWNprevBridge.php
+++ b/bridges/LWNprevBridge.php
@@ -11,9 +11,9 @@ class LWNprevBridge extends BridgeAbstract{
 	}
 
 	private function jumpToNextTag(&$node){
-		while($node && $node->nodeType === XML_TEXT_NODE){
+		while($node && $node->nodeType === XML_TEXT_NODE) {
 			$nextNode = $node->nextSibling;
-			if(!$nextNode){
+			if(!$nextNode) {
 				break;
 			}
 			$node = $nextNode;
@@ -21,9 +21,9 @@ class LWNprevBridge extends BridgeAbstract{
 	}
 
 	private function jumpToPreviousTag(&$node){
-		while($node && $node->nodeType === XML_TEXT_NODE){
+		while($node && $node->nodeType === XML_TEXT_NODE) {
 			$previousNode = $node->previousSibling;
-			if(!$previousNode){
+			if(!$previousNode) {
 				break;
 			}
 			$node = $previousNode;
@@ -44,8 +44,8 @@ class LWNprevBridge extends BridgeAbstract{
 		$cat1 = '';
 		$cat2 = '';
 
-		foreach($html->getElementsByTagName('a') as $a){
-			if($a->textContent === 'Multi-page format'){
+		foreach($html->getElementsByTagName('a') as $a) {
+			if($a->textContent === 'Multi-page format') {
 				break;
 			}
 		}
@@ -57,8 +57,8 @@ class LWNprevBridge extends BridgeAbstract{
 			substr($edition, strpos($edition, 'for ') + strlen('for '))
 		);
 
-		foreach($html->getElementsByTagName('h2') as $h2){
-			if($h2->getAttribute('class') !== 'SummaryHL'){
+		foreach($html->getElementsByTagName('h2') as $h2) {
+			if($h2->getAttribute('class') !== 'SummaryHL') {
 				continue;
 			}
 
@@ -67,7 +67,7 @@ class LWNprevBridge extends BridgeAbstract{
 			$h2NextSibling = $h2->nextSibling;
 			$this->jumpToNextTag($h2NextSibling);
 
-			switch($h2NextSibling->getAttribute('class')){
+			switch($h2NextSibling->getAttribute('class')) {
 			case 'FeatureByline':
 				$item['author'] = $h2NextSibling->getElementsByTagName('b')->item(0)->textContent;
 				break;
@@ -82,9 +82,9 @@ class LWNprevBridge extends BridgeAbstract{
 
 			$h2FirstChild = $h2->firstChild;
 			$this->jumpToNextTag($h2FirstChild);
-			if($h2FirstChild->nodeName === 'a'){
+			if($h2FirstChild->nodeName === 'a') {
 				$item['uri'] = self::URI . $h2FirstChild->getAttribute('href');
-			}else{
+			} else{
 				$item['uri'] = $realURI . '#' . $URICounter;
 			}
 			$URICounter++;
@@ -93,12 +93,12 @@ class LWNprevBridge extends BridgeAbstract{
 
 			$h2PrevSibling = $h2->previousSibling;
 			$this->jumpToPreviousTag($h2PrevSibling);
-			switch($h2PrevSibling->getAttribute('class')){
+			switch($h2PrevSibling->getAttribute('class')) {
 			case 'Cat2HL':
 				$cat2 = $h2PrevSibling->textContent;
 				$h2PrevSibling = $h2PrevSibling->previousSibling;
 				$this->jumpToPreviousTag($h2PrevSibling);
-				if($h2PrevSibling->getAttribute('class') !== 'Cat1HL'){
+				if($h2PrevSibling->getAttribute('class') !== 'Cat1HL') {
 					break;
 				}
 				$cat1 = $h2PrevSibling->textContent;
@@ -113,7 +113,7 @@ class LWNprevBridge extends BridgeAbstract{
 			$h2PrevSibling = null;
 
 			$item['title'] = '';
-			if(!empty($cat1)){
+			if(!empty($cat1)) {
 				$item['title'] .= '[' . $cat1 . ($cat2 ? '/' . $cat2 : '') . '] ';
 			}
 			$item['title'] .= $h2->textContent;
@@ -121,7 +121,7 @@ class LWNprevBridge extends BridgeAbstract{
 			$node = $h2;
 			$content = '';
 			$contentEnd = false;
-			while(!$contentEnd){
+			while(!$contentEnd) {
 				$node = $node->nextSibling;
 				if(!$node || (
 						$node->nodeType !== XML_TEXT_NODE && (
@@ -132,9 +132,9 @@ class LWNprevBridge extends BridgeAbstract{
 							)
 						)
 					)
-				){
+				) {
 					$contentEnd = true;
-				}else{
+				} else{
 					$content .= $node->C14N();
 				}
 			}
diff --git a/bridges/LeBonCoinBridge.php b/bridges/LeBonCoinBridge.php
index 89413883..d4da546e 100755
--- a/bridges/LeBonCoinBridge.php
+++ b/bridges/LeBonCoinBridge.php
@@ -141,7 +141,7 @@ region, and optionally a category and a keyword .';
 	public function collectData(){
 
 		$category = $this->getInput('c');
-		if(empty($category)){
+		if(empty($category)) {
 				$category = 'annonces';
 		}
 
@@ -154,13 +154,13 @@ region, and optionally a category and a keyword .';
 			or returnServerError('Could not request LeBonCoin.');
 
 		$list = $html->find('.tabsContent', 0);
-		if($list === null){
+		if($list === null) {
 			return;
 		}
 
 		$tags = $list->find('li');
 
-		foreach($tags as $element){
+		foreach($tags as $element) {
 
 			$element = $element->find('a', 0);
 
@@ -169,7 +169,7 @@ region, and optionally a category and a keyword .';
 			$title = html_entity_decode($element->getAttribute('title'));
 			$content_image = $element->find('div.item_image', 0)->find('.lazyload', 0);
 
-			if($content_image !== null){
+			if($content_image !== null) {
 				$content = '<img src="' . $content_image->getAttribute('data-imgsrc') . '" alt="thumbnail">';
 			} else {
 				$content = "";
diff --git a/bridges/LeMondeInformatiqueBridge.php b/bridges/LeMondeInformatiqueBridge.php
index e315f937..706752ff 100644
--- a/bridges/LeMondeInformatiqueBridge.php
+++ b/bridges/LeMondeInformatiqueBridge.php
@@ -27,7 +27,7 @@ class LeMondeInformatiqueBridge extends FeedExpander {
 	}
 
 	private function stripWithDelimiters($string, $start, $end){
-		while(strpos($string, $start) !== false){
+		while(strpos($string, $start) !== false) {
 			$section_to_remove = substr($string, strpos($string, $start));
 			$section_to_remove = substr($section_to_remove, 0, strpos($section_to_remove, $end) + strlen($end));
 			$string = str_replace($section_to_remove, '', $string);
diff --git a/bridges/LegifranceJOBridge.php b/bridges/LegifranceJOBridge.php
index 2233db4a..348be8f1 100644
--- a/bridges/LegifranceJOBridge.php
+++ b/bridges/LegifranceJOBridge.php
@@ -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);
diff --git a/bridges/LesJoiesDuCodeBridge.php b/bridges/LesJoiesDuCodeBridge.php
index 79dfc5ea..34145a1d 100644
--- a/bridges/LesJoiesDuCodeBridge.php
+++ b/bridges/LesJoiesDuCodeBridge.php
@@ -11,7 +11,7 @@ class LesJoiesDuCodeBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM(self::URI)
 			or returnServerError('Could not request LesJoiesDuCode.');
 
-		foreach($html->find('div.blog-post') as $element){
+		foreach($html->find('div.blog-post') as $element) {
 			$item = array();
 			$temp = $element->find('h1 a', 0);
 			$titre = html_entity_decode($temp->innertext);
@@ -21,7 +21,7 @@ class LesJoiesDuCodeBridge extends BridgeAbstract {
 
 			// retrieve .gif instead of static .jpg
 			$images = $temp->find('p img');
-			foreach($images as $image){
+			foreach($images as $image) {
 				$img_src = str_replace(".jpg", ".gif", $image->src);
 				$image->src = $img_src;
 			}
@@ -30,7 +30,7 @@ class LesJoiesDuCodeBridge extends BridgeAbstract {
 			$auteur = $temp->find('i', 0);
 			$pos = strpos($auteur->innertext, "by");
 
-			if($pos > 0){
+			if($pos > 0) {
 				$auteur = trim(str_replace("*/", "", substr($auteur->innertext, ($pos + 2))));
 				$item['author'] = $auteur;
 			}
diff --git a/bridges/LinkedInCompanyBridge.php b/bridges/LinkedInCompanyBridge.php
index 73cdcbf0..e629211d 100644
--- a/bridges/LinkedInCompanyBridge.php
+++ b/bridges/LinkedInCompanyBridge.php
@@ -22,9 +22,9 @@ class LinkedInCompanyBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM($link)
 			or returnServerError('Could not request LinkedIn.');
 
-		foreach($html->find('//*[@id="my-feed-post"]/li') as $element){
+		foreach($html->find('//*[@id="my-feed-post"]/li') as $element) {
 			$title = $element->find('span.share-body', 0)->innertext;
-			if($title){
+			if($title) {
 				$item = array();
 				$item['uri'] = $link;
 				$item['title'] = mb_substr(strip_tags($element->find('span.share-body', 0)->innertext), 0, 100);
diff --git a/bridges/MangareaderBridge.php b/bridges/MangareaderBridge.php
index 6dd746f3..cd7dddc1 100644
--- a/bridges/MangareaderBridge.php
+++ b/bridges/MangareaderBridge.php
@@ -80,7 +80,7 @@ class MangareaderBridge extends BridgeAbstract {
 	public function collectData(){
 		// We'll use the DOM parser for this as it makes navigation easier
 		$html = getContents($this->getURI());
-		if(!$html){
+		if(!$html) {
 			returnClientError('Could not receive data for ' . $path . '!');
 		}
 		libxml_use_internal_errors(true);
@@ -92,7 +92,7 @@ class MangareaderBridge extends BridgeAbstract {
 		$xpath = new DomXPath($doc);
 
 		$this->request = '';
-		switch($this->queriedContext){
+		switch($this->queriedContext) {
 		case 'Get latest updates':
 			$this->request = 'Latest updates';
 			$this->getLatestUpdates($xpath);
@@ -105,7 +105,7 @@ class MangareaderBridge extends BridgeAbstract {
 			break;
 		case 'Get manga updates':
 			$limit = $this->getInput('limit');
-			if(empty($limit)){
+			if(empty($limit)) {
 				$limit = self::PARAMETERS[$this->queriedContext]['limit']['defaultValue'];
 			}
 
@@ -118,7 +118,7 @@ class MangareaderBridge extends BridgeAbstract {
 		}
 
 		// Return some dummy-data if no content available
-		if(empty($this->items)){
+		if(empty($this->items)) {
 			$item = array();
 			$item['content'] = "<p>No updates available</p>";
 
@@ -130,14 +130,14 @@ class MangareaderBridge extends BridgeAbstract {
 		// Query each item (consists of Manga + chapters)
 		$nodes = $xpath->query("//*[@id='latestchapters']/table//td");
 
-		foreach ($nodes as $node){
+		foreach ($nodes as $node) {
 			// Query the manga
 			$manga = $xpath->query("a[@class='chapter']", $node)->item(0);
 
 			// Collect the chapters for each Manga
 			$chapters = $xpath->query("a[@class='chaptersrec']", $node);
 
-			if (isset($manga) && $chapters->length >= 1){
+			if (isset($manga) && $chapters->length >= 1) {
 				$item = array();
 				$item['uri'] = self::URI . htmlspecialchars($manga->getAttribute('href'));
 				$item['title'] = htmlspecialchars($manga->nodeValue);
@@ -145,8 +145,8 @@ class MangareaderBridge extends BridgeAbstract {
 				// Add each chapter to the feed
 				$item['content'] = "";
 
-				foreach ($chapters as $chapter){
-					if($item['content'] <> ""){
+				foreach ($chapters as $chapter) {
+					if($item['content'] <> "") {
 						$item['content'] .= "<br>";
 					}
 					$item['content'] .= "<a href='"
@@ -166,7 +166,7 @@ class MangareaderBridge extends BridgeAbstract {
 		// Query all mangas
 		$mangas = $xpath->query("//*[@id='mangaresults']/*[@class='mangaresultitem']");
 
-		foreach ($mangas as $manga){
+		foreach ($mangas as $manga) {
 
 			// The thumbnail is encrypted in a css-style...
 			// format: "background-image:url('<the part which is actually interesting>')"
@@ -203,13 +203,13 @@ EOD;
 	private function getMangaUpdates($xpath, $limit){
 		$query = "(.//*[@id='listing']//tr)[position() > 1]";
 
-		if($limit !== -1){
+		if($limit !== -1) {
 			$query = "(.//*[@id='listing']//tr)[position() > 1][position() > last() - {$limit}]";
 		}
 
 		$chapters = $xpath->query($query);
 
-		foreach ($chapters as $chapter){
+		foreach ($chapters as $chapter) {
 			$item = array();
 			$item['title'] = htmlspecialchars($xpath->query("td[1]", $chapter)
 				->item(0)
@@ -225,13 +225,13 @@ EOD;
 	}
 
 	public function getURI(){
-		switch($this->queriedContext){
+		switch($this->queriedContext) {
 		case 'Get latest updates':
 			$path = "latest";
 			break;
 		case 'Get popular mangas':
 			$path = "popular";
-			if($this->getInput('category') !== "all"){
+			if($this->getInput('category') !== "all") {
 				$path .= "/" . $this->getInput('category');
 			}
 			break;
diff --git a/bridges/MixCloudBridge.php b/bridges/MixCloudBridge.php
index 073cdf2c..aa6340a1 100644
--- a/bridges/MixCloudBridge.php
+++ b/bridges/MixCloudBridge.php
@@ -16,7 +16,7 @@ class MixCloudBridge extends BridgeAbstract {
 	));
 
 	public function getName(){
-		if(!is_null($this->getInput('u'))){
+		if(!is_null($this->getInput('u'))) {
 			return 'MixCloud - ' . $this->getInput('u');
 		}
 
@@ -28,7 +28,7 @@ class MixCloudBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM(self::URI . $this->getInput('u'))
 			or returnServerError('Could not request MixCloud.');
 
-		foreach($html->find('section.card') as $element){
+		foreach($html->find('section.card') as $element) {
 
 			$item = array();
 
@@ -40,7 +40,7 @@ class MixCloudBridge extends BridgeAbstract {
 
 			$image = $element->find('a.album-art img', 0);
 
-			if($image){
+			if($image) {
 				$item['content'] = '<img src="' . $image->getAttribute('src') . '" />';
 			}
 
diff --git a/bridges/MoebooruBridge.php b/bridges/MoebooruBridge.php
index 787a45f7..9d9a625b 100644
--- a/bridges/MoebooruBridge.php
+++ b/bridges/MoebooruBridge.php
@@ -35,7 +35,7 @@ class MoebooruBridge extends BridgeAbstract {
 			$data[] = preg_replace('/}\)(.*)/', '}', $element);
 		unset($data[0]);
 
-		foreach($data as $datai){
+		foreach($data as $datai) {
 			$json = json_decode($datai, true);
 			$item = array();
 			$item['uri'] = $this->getURI() . '/post/show/' . $json['id'];
diff --git a/bridges/MoinMoinBridge.php b/bridges/MoinMoinBridge.php
index d57f1b0b..5b41924a 100644
--- a/bridges/MoinMoinBridge.php
+++ b/bridges/MoinMoinBridge.php
@@ -92,17 +92,17 @@ class MoinMoinBridge extends BridgeAbstract {
 
 		$sections = $this->splitSections($html);
 
-		foreach($sections as $section){
+		foreach($sections as $section) {
 			$item = array();
 
 			$item['uri'] = $this->findSectionAnchor($section[0]);
 
-			switch($this->getInput('content')){
+			switch($this->getInput('content')) {
 				case 'none': // Do not return any content
 					break;
 				case 'follow': // Follow the anchor
 					// We can only follow anchors (use default otherwise)
-					if($this->getInput('separator') === 'a'){
+					if($this->getInput('separator') === 'a') {
 						$content = $this->followAnchor($item['uri']);
 
 						// Return only actual content
@@ -124,14 +124,14 @@ class MoinMoinBridge extends BridgeAbstract {
 			$item['title'] = strip_tags($section[1]);
 
 			// Skip items with empty title
-			if(empty(trim($item['title']))){
+			if(empty(trim($item['title']))) {
 				continue;
 			}
 
 			$this->items[] = $item;
 
 			if($this->getInput('limit') > 0
-			&& count($this->items) >= $this->getInput('limit')){
+			&& count($this->items) >= $this->getInput('limit')) {
 				break;
 			}
 		}
@@ -177,7 +177,7 @@ class MoinMoinBridge extends BridgeAbstract {
 		);
 
 		// Some pages don't use headers, return page as one feed
-		if(count($sections) === 0){
+		if(count($sections) === 0) {
 			return array(
 				array(
 					$content,
@@ -198,13 +198,13 @@ class MoinMoinBridge extends BridgeAbstract {
 
 		// For IDs
 		$anchor = $html->find($this->getInput('separator') . '[id=]', 0);
-		if(!is_null($anchor)){
+		if(!is_null($anchor)) {
 			return $this->getInput('source') . '#' . $anchor->id;
 		}
 
 		// For actual anchors
 		$anchor = $html->find($this->getInput('separator') . '[href=]', 0);
-		if(!is_null($anchor)){
+		if(!is_null($anchor)) {
 			return $anchor->href;
 		}
 
@@ -225,11 +225,11 @@ class MoinMoinBridge extends BridgeAbstract {
 		*/
 		$pageinfo = $html->find('[id="pageinfo"]', 0);
 
-		if(is_null($pageinfo)){
+		if(is_null($pageinfo)) {
 			return null;
 		} else {
 			$author = $pageinfo->find('[title=]', 0);
-			if(is_null($author)){
+			if(is_null($author)) {
 				return null;
 			} else {
 				return trim(explode('@', $author->title)[0]);
@@ -246,7 +246,7 @@ class MoinMoinBridge extends BridgeAbstract {
 		// See example of findAuthor()
 		$pageinfo = $html->find('[id="pageinfo"]', 0);
 
-		if(is_null($pageinfo)){
+		if(is_null($pageinfo)) {
 			return null;
 		} else {
 			$timestamp = $pageinfo->innertext;
@@ -264,8 +264,8 @@ class MoinMoinBridge extends BridgeAbstract {
 
 		$source = $source ?: $this->getURI();
 
-		foreach($html->find('a') as $anchor){
-			switch(substr($anchor->href, 0, 1)){
+		foreach($html->find('a') as $anchor) {
+			switch(substr($anchor->href, 0, 1)) {
 				case 'h': // http or https, no actions required
 					break;
 				case '/': // some relative path
@@ -287,12 +287,12 @@ class MoinMoinBridge extends BridgeAbstract {
 	 * wiki domain)
 	 */
 	private function followAnchor($anchor){
-		if(strrpos($anchor, $this->findDomain($this->getInput('source')) === false)){
+		if(strrpos($anchor, $this->findDomain($this->getInput('source')) === false)) {
 			return null;
 		}
 
 		$html = getSimpleHTMLDOMCached($anchor);
-		if(!$html){ // Cannot load article
+		if(!$html) { // Cannot load article
 			return null;
 		}
 
@@ -310,7 +310,7 @@ class MoinMoinBridge extends BridgeAbstract {
 
 	/* This function is a copy from CNETBridge */
 	private function stripWithDelimiters($string, $start, $end){
-		while(strpos($string, $start) !== false){
+		while(strpos($string, $start) !== false) {
 			$section_to_remove = substr($string, strpos($string, $start));
 			$section_to_remove = substr($section_to_remove, 0, strpos($section_to_remove, $end) + strlen($end));
 			$string = str_replace($section_to_remove, '', $string);
diff --git a/bridges/MondeDiploBridge.php b/bridges/MondeDiploBridge.php
index b543c64b..85f771e3 100644
--- a/bridges/MondeDiploBridge.php
+++ b/bridges/MondeDiploBridge.php
@@ -11,7 +11,7 @@ class MondeDiploBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM(self::URI)
 			or returnServerError('Could not request MondeDiplo. for : ' . self::URI);
 
-		foreach($html->find('div.unarticle') as $article){
+		foreach($html->find('div.unarticle') as $article) {
 			$element = $article->parent();
 			$item = array();
 			$item['uri'] = self::URI . $element->href;
diff --git a/bridges/MsnMondeBridge.php b/bridges/MsnMondeBridge.php
index 81a8dd83..12d3d2fc 100644
--- a/bridges/MsnMondeBridge.php
+++ b/bridges/MsnMondeBridge.php
@@ -21,8 +21,8 @@ class MsnMondeBridge extends BridgeAbstract {
 			or returnServerError('Could not request MsnMonde.');
 
 		$limit = 0;
-		foreach($html->find('.smalla') as $article){
-			if($limit < 10){
+		foreach($html->find('.smalla') as $article) {
+			if($limit < 10) {
 				$item = array();
 				$item['title'] = utf8_decode($article->find('h4', 0)->innertext);
 				$item['uri'] = self::URI . utf8_decode($article->find('a', 0)->href);
diff --git a/bridges/NasaApodBridge.php b/bridges/NasaApodBridge.php
index dcf84244..74fd219b 100644
--- a/bridges/NasaApodBridge.php
+++ b/bridges/NasaApodBridge.php
@@ -14,7 +14,7 @@ class NasaApodBridge extends BridgeAbstract {
 
 		$list = explode("<br>", $html->find('b', 0)->innertext);
 
-		for($i = 0; $i < 3; $i++){
+		for($i = 0; $i < 3; $i++) {
 			$line = $list[$i];
 			$item = array();
 
diff --git a/bridges/NeuviemeArtBridge.php b/bridges/NeuviemeArtBridge.php
index 2b899411..d0954fc3 100644
--- a/bridges/NeuviemeArtBridge.php
+++ b/bridges/NeuviemeArtBridge.php
@@ -7,7 +7,7 @@ class NeuviemeArtBridge extends FeedExpander {
 	const DESCRIPTION = 'Returns the newest articles.';
 
 	private function stripWithDelimiters($string, $start, $end){
-		while(strpos($string, $start) !== false){
+		while(strpos($string, $start) !== false) {
 			$section_to_remove = substr($string, strpos($string, $start));
 			$section_to_remove = substr($section_to_remove, 0, strpos($section_to_remove, $end) + strlen($end));
 			$string = str_replace($section_to_remove, '', $string);
@@ -20,21 +20,21 @@ class NeuviemeArtBridge extends FeedExpander {
 		$item = parent::parseItem($item);
 
 		$article_html = getSimpleHTMLDOMCached($item['uri']);
-		if(!$article_html){
+		if(!$article_html) {
 			$item['content'] = 'Could not request 9eme Art: ' . $item['uri'];
 			return $item;
 		}
 
 		$article_image = '';
-		foreach ($article_html->find('img.img_full') as $img){
-			if ($img->alt == $item['title']){
+		foreach ($article_html->find('img.img_full') as $img) {
+			if ($img->alt == $item['title']) {
 				$article_image = self::URI . $img->src;
 				break;
 			}
 		}
 
 		$article_content = '';
-		if($article_image){
+		if($article_image) {
 			$article_content = '<p><img src="' . $article_image . '" /></p>';
 		}
 		$article_content .= str_replace(
diff --git a/bridges/NextgovBridge.php b/bridges/NextgovBridge.php
index c141e612..370b0bf6 100644
--- a/bridges/NextgovBridge.php
+++ b/bridges/NextgovBridge.php
@@ -35,9 +35,9 @@ class NextgovBridge extends FeedExpander {
 		$item['content'] = '';
 
 		$namespaces = $newsItem->getNamespaces(true);
-		if(isset($namespaces['media'])){
+		if(isset($namespaces['media'])) {
 			$media = $newsItem->children($namespaces['media']);
-			if(isset($media->content)){
+			if(isset($media->content)) {
 				$attributes = $media->content->attributes();
 				$item['content'] = '<img src="' . $attributes['url'] . '">';
 			}
diff --git a/bridges/NovelUpdatesBridge.php b/bridges/NovelUpdatesBridge.php
index 5a2a8dab..729eb485 100644
--- a/bridges/NovelUpdatesBridge.php
+++ b/bridges/NovelUpdatesBridge.php
@@ -17,7 +17,7 @@ class NovelUpdatesBridge extends BridgeAbstract {
 	private $seriesTitle = '';
 
 	public function getURI(){
-		if(!is_null($this->getInput('n'))){
+		if(!is_null($this->getInput('n'))) {
 			return static::URI . '/series/' . $this->getInput('n') . '/';
 		}
 
@@ -35,7 +35,7 @@ class NovelUpdatesBridge extends BridgeAbstract {
 		$html = stristr($html, '<tbody>'); //strip thead
 		$html = stristr($html, '<tr>'); //remove tbody
 		$html = str_get_html(stristr($html, '</tbody>', true)); //remove last tbody and get back as an array
-		foreach($html->find('tr') as $element){
+		foreach($html->find('tr') as $element) {
 				$item = array();
 				$item['uri'] = $element->find('td', 2)->find('a', 0)->href;
 				$item['title'] = $element->find('td', 2)->find('a', 0)->plaintext;
@@ -60,7 +60,7 @@ class NovelUpdatesBridge extends BridgeAbstract {
 	}
 
 		public function getName(){
-			if(!empty($this->seriesTitle)){
+			if(!empty($this->seriesTitle)) {
 				return $this->seriesTitle . ' - ' . static::NAME;
 			}
 
diff --git a/bridges/OpenClassroomsBridge.php b/bridges/OpenClassroomsBridge.php
index eb4366cc..5f0daca4 100644
--- a/bridges/OpenClassroomsBridge.php
+++ b/bridges/OpenClassroomsBridge.php
@@ -27,7 +27,7 @@ class OpenClassroomsBridge extends BridgeAbstract {
 	));
 
 	public function getURI(){
-		if(!is_null($this->getInput('u'))){
+		if(!is_null($this->getInput('u'))) {
 			return self::URI . '/courses?categories=' . $this->getInput('u') . '&title=&sort=updatedAt+desc';
 		}
 
@@ -38,7 +38,7 @@ class OpenClassroomsBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM($this->getURI())
 			or returnServerError('Could not request OpenClassrooms.');
 
-		foreach($html->find('.courseListItem') as $element){
+		foreach($html->find('.courseListItem') as $element) {
 				$item = array();
 				$item['uri'] = self::URI . $element->find('a', 0)->href;
 				$item['title'] = $element->find('h3', 0)->plaintext;
diff --git a/bridges/ParuVenduImmoBridge.php b/bridges/ParuVenduImmoBridge.php
index 5d050ae6..a2e2b335 100644
--- a/bridges/ParuVenduImmoBridge.php
+++ b/bridges/ParuVenduImmoBridge.php
@@ -29,15 +29,15 @@ class ParuVenduImmoBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM($this->getURI())
 			or returnServerError('Could not request paruvendu.');
 
-		foreach($html->find('div.annonce a') as $element){
+		foreach($html->find('div.annonce a') as $element) {
 
-			if(!$element->title){
+			if(!$element->title) {
 				continue;
 			}
 
 			$img = '';
-			foreach($element->find('span.img img') as $img){
-				if($img->original){
+			foreach($element->find('span.img img') as $img) {
+				if($img->original) {
 					$img = '<img src="' . $img->original . '" />';
 				}
 			}
@@ -65,33 +65,33 @@ class ParuVenduImmoBridge extends BridgeAbstract {
 		. $appartment
 		. $maison;
 
-		if($this->getInput('minarea')){
+		if($this->getInput('minarea')) {
 			$link .= '&sur0=' . urlencode($this->getInput('minarea'));
 		}
 
-		if($this->getInput('maxprice')){
+		if($this->getInput('maxprice')) {
 			$link .= '&px1=' . urlencode($this->getInput('maxprice'));
 		}
 
-		if($this->getInput('pa')){
+		if($this->getInput('pa')) {
 			$link .= '&pa=' . urlencode($this->getInput('pa'));
 		}
 
-		if($this->getInput('lo')){
+		if($this->getInput('lo')) {
 			$link .= '&lo=' . urlencode($this->getInput('lo'));
 		}
 		return $link;
 	}
 
 	public function getName(){
-		if(!is_null($this->getInput('minarea'))){
+		if(!is_null($this->getInput('minarea'))) {
 			$request = '';
 			$minarea = $this->getInput('minarea');
-			if(!empty($minarea)){
+			if(!empty($minarea)) {
 				$request .= ' ' . $minarea . ' m2';
 			}
 			$location = $this->getInput('lo');
-			if(!empty($location)){
+			if(!empty($location)) {
 				$request .= ' In: ' . $location;
 			}
 			return 'Paru Vendu Immobilier' . $request;
diff --git a/bridges/PickyWallpapersBridge.php b/bridges/PickyWallpapersBridge.php
index 340474e3..6c26df7a 100644
--- a/bridges/PickyWallpapersBridge.php
+++ b/bridges/PickyWallpapersBridge.php
@@ -34,16 +34,16 @@ class PickyWallpapersBridge extends BridgeAbstract {
 		$max = $this->getInput('m');
 		$resolution = $this->getInput('r'); // Wide wallpaper default
 
-		for($page = 1; $page <= $lastpage; $page++){
+		for($page = 1; $page <= $lastpage; $page++) {
 			$html = getSimpleHTMLDOM($this->getURI() . '/page-' . $page . '/')
 				or returnServerError('No results for this query.');
 
-			if($page === 1){
+			if($page === 1) {
 				preg_match('/page-(\d+)\/$/', $html->find('.pages li a', -2)->href, $matches);
 				$lastpage = min($matches[1], ceil($max / 12));
 			}
 
-			foreach($html->find('.items li img') as $element){
+			foreach($html->find('.items li img') as $element) {
 				$item = array();
 				$item['uri'] = str_replace('www', 'wallpaper', self::URI)
 				. '/'
@@ -70,7 +70,7 @@ class PickyWallpapersBridge extends BridgeAbstract {
 	}
 
 	public function getURI(){
-		if(!is_null($this->getInput('s')) && !is_null($this->getInput('r')) && !is_null($this->getInput('c'))){
+		if(!is_null($this->getInput('s')) && !is_null($this->getInput('r')) && !is_null($this->getInput('c'))) {
 			$subcategory = $this->getInput('s');
 			$link = self::URI
 			. $this->getInput('r')
@@ -86,7 +86,7 @@ class PickyWallpapersBridge extends BridgeAbstract {
 	}
 
 	public function getName(){
-		if(!is_null($this->getInput('s'))){
+		if(!is_null($this->getInput('s'))) {
 			$subcategory = $this->getInput('s');
 			return 'PickyWallpapers - '
 			. $this->getInput('c')
diff --git a/bridges/PinterestBridge.php b/bridges/PinterestBridge.php
index 13815d87..c5282ff5 100644
--- a/bridges/PinterestBridge.php
+++ b/bridges/PinterestBridge.php
@@ -32,9 +32,9 @@ class PinterestBridge extends FeedExpander {
 	);
 
 	public function collectData(){
-		switch($this->queriedContext){
+		switch($this->queriedContext) {
 			case 'By username and board':
-				if($this->getInput('r')){
+				if($this->getInput('r')) {
 					$html = getSimpleHTMLDOMCached($this->getURI());
 					$this->getUserResults($html);
 				} else {
@@ -55,7 +55,7 @@ class PinterestBridge extends FeedExpander {
 		$fullname = $json['resourceDataCache'][0]['data']['owner']['full_name'];
 		$avatar = $json['resourceDataCache'][0]['data']['owner']['image_small_url'];
 
-		foreach($results as $result){
+		foreach($results as $result) {
 			$item = array();
 
 			$item['uri'] = $result['link'];
@@ -97,7 +97,7 @@ class PinterestBridge extends FeedExpander {
 		$json = json_decode($html->find('#jsInit1', 0)->innertext, true);
 		$results = $json['resourceDataCache'][0]['data']['results'];
 
-		foreach($results as $result){
+		foreach($results as $result) {
 			$item = array();
 
 			$item['uri'] = self::URI . $result['board']['url'];
@@ -136,7 +136,7 @@ class PinterestBridge extends FeedExpander {
 	}
 
 	public function getURI(){
-		switch($this->queriedContext){
+		switch($this->queriedContext) {
 		case 'By username and board':
 			$uri = self::URI . '/' . urlencode($this->getInput('u')) . '/' . urlencode($this->getInput('b'));// . '.rss';
 			break;
@@ -149,7 +149,7 @@ class PinterestBridge extends FeedExpander {
 	}
 
 	public function getName(){
-		switch($this->queriedContext){
+		switch($this->queriedContext) {
 		case 'By username and board':
 			$specific = $this->getInput('u') . ' - ' . $this->getInput('b');
 		break;
diff --git a/bridges/PlanetLibreBridge.php b/bridges/PlanetLibreBridge.php
index ecf687bd..03a6024d 100644
--- a/bridges/PlanetLibreBridge.php
+++ b/bridges/PlanetLibreBridge.php
@@ -16,8 +16,8 @@ class PlanetLibreBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM(self::URI)
 			or returnServerError('Could not request PlanetLibre.');
 		$limit = 0;
-		foreach($html->find('div.post') as $element){
-			if($limit < 5){
+		foreach($html->find('div.post') as $element) {
+			if($limit < 5) {
 				$item = array();
 				$item['title'] = $element->find('h1', 0)->plaintext;
 				$item['uri'] = $element->find('a', 0)->href;
diff --git a/bridges/RTBFBridge.php b/bridges/RTBFBridge.php
index e622a055..22cdaf41 100644
--- a/bridges/RTBFBridge.php
+++ b/bridges/RTBFBridge.php
@@ -22,8 +22,8 @@ class RTBFBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM($this->getURI())
 			or returnServerError('Could not request RTBF.');
 
-		foreach($html->find('section[id!=widget-ml-avoiraussi-] .rtbf-media-grid article') as $element){
-			if($count >= $limit){
+		foreach($html->find('section[id!=widget-ml-avoiraussi-] .rtbf-media-grid article') as $element) {
+			if($count >= $limit) {
 				break;
 			}
 
@@ -49,7 +49,7 @@ class RTBFBridge extends BridgeAbstract {
 	}
 
 	public function getURI(){
-		if(!is_null($this->getInput('c'))){
+		if(!is_null($this->getInput('c'))) {
 			return self::URI . 'emissions/detail?id=' . $this->getInput('c');
 		}
 
@@ -57,7 +57,7 @@ class RTBFBridge extends BridgeAbstract {
 	}
 
 	public function getName(){
-		if(!is_null($this->getInput('c'))){
+		if(!is_null($this->getInput('c'))) {
 			return $this->getInput('c') .' - RTBF Bridge';
 		}
 
diff --git a/bridges/RainbowSixSiegeBridge.php b/bridges/RainbowSixSiegeBridge.php
index 1e0fa9db..302bb896 100644
--- a/bridges/RainbowSixSiegeBridge.php
+++ b/bridges/RainbowSixSiegeBridge.php
@@ -17,7 +17,7 @@ class RainbowSixSiegeBridge extends BridgeAbstract {
 		$json = $json['items'];
 
 		// Start at index 2 to remove highlighted articles
-		for($i = 0; $i < count($json); $i++){
+		for($i = 0; $i < count($json); $i++) {
 			$jsonItem = $json[$i]['Content'];
 			$article = str_get_html($jsonItem);
 
diff --git a/bridges/ReadComicsBridge.php b/bridges/ReadComicsBridge.php
index 8540fe3e..33c8ed9e 100644
--- a/bridges/ReadComicsBridge.php
+++ b/bridges/ReadComicsBridge.php
@@ -26,11 +26,11 @@ class ReadComicsBridge extends BridgeAbstract {
 		}
 
 		$keywordsList = explode(";", $this->getInput('q'));
-		foreach($keywordsList as $keywords){
+		foreach($keywordsList as $keywords) {
 			$html = $this->getSimpleHTMLDOM(self::URI . 'comic/' . rawurlencode($keywords))
 				or $this->returnServerError('Could not request readcomics.tv.');
 
-			foreach($html->find('li') as $element){
+			foreach($html->find('li') as $element) {
 				$item = array();
 				$item['uri'] = $element->find('a.ch-name', 0)->href;
 				$item['id'] = $item['uri'];
diff --git a/bridges/Releases3DSBridge.php b/bridges/Releases3DSBridge.php
index c14e576e..a7e1778e 100644
--- a/bridges/Releases3DSBridge.php
+++ b/bridges/Releases3DSBridge.php
@@ -10,7 +10,7 @@ class Releases3DSBridge extends BridgeAbstract {
 	public function collectData(){
 
 		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;
@@ -20,7 +20,7 @@ class Releases3DSBridge extends BridgeAbstract {
 		}
 
 		function typeToString($type){
-			switch($type){
+			switch($type) {
 				case 1: return '3DS Game';
 				case 4: return 'eShop';
 				default: return '??? (' . $type . ')';
@@ -28,7 +28,7 @@ class Releases3DSBridge extends BridgeAbstract {
 		}
 
 		function cardToString($card){
-			switch($card){
+			switch($card) {
 				case 1: return 'Regular (CARD1)';
 				case 2: return 'NAND (CARD2)';
 				default: return '??? (' . $card . ')';
@@ -40,17 +40,17 @@ class Releases3DSBridge extends BridgeAbstract {
 			or returnServerError('Could not request 3dsdb: ' . $dataUrl);
 		$limit = 0;
 
-		foreach(array_reverse(explode('<release>', $xml)) as $element){
-			if($limit >= 5){
+		foreach(array_reverse(explode('<release>', $xml)) as $element) {
+			if($limit >= 5) {
 				break;
 			}
 
-			if(strpos($element, '</release>') === false){
+			if(strpos($element, '</release>') === false) {
 				continue;
 			}
 
 			$releasename = extractFromDelimiters($element, '<releasename>', '</releasename>');
-			if(empty($releasename)){
+			if(empty($releasename)) {
 				continue;
 			}
 
@@ -77,7 +77,7 @@ class Releases3DSBridge extends BridgeAbstract {
 			$ignCoverArt = '';
 
 			$ignSearchUrl = 'http://www.ign.com/search?q=' . urlencode($name);
-			if($ignResult = getSimpleHTMLDOM($ignSearchUrl)){
+			if($ignResult = getSimpleHTMLDOM($ignSearchUrl)) {
 				$ignCoverArt = $ignResult->find('div.search-item-media', 0)->find('img', 0)->src;
 				$ignDesc = $ignResult->find('div.search-item-description', 0)->plaintext;
 				$ignLink = $ignResult->find('div.search-item-sub-title', 0)->find('a', 1)->href;
diff --git a/bridges/ReporterreBridge.php b/bridges/ReporterreBridge.php
index dff8818f..db1104c1 100644
--- a/bridges/ReporterreBridge.php
+++ b/bridges/ReporterreBridge.php
@@ -9,7 +9,7 @@ class ReporterreBridge extends BridgeAbstract {
 		private function extractContent($url){
 			$html2 = getSimpleHTMLDOM($url);
 
-			foreach($html2->find('div[style=text-align:justify]') as $e){
+			foreach($html2->find('div[style=text-align:justify]') as $e) {
 				$text = $e->outertext;
 			}
 
@@ -32,7 +32,7 @@ class ReporterreBridge extends BridgeAbstract {
 			or returnServerError('Could not request Reporterre.');
 		$limit = 0;
 
-		foreach($html->find('item') as $element){
+		foreach($html->find('item') as $element) {
 			if($limit < 5) {
 				$item = array();
 				$item['title'] = html_entity_decode($element->find('title', 0)->plaintext);
diff --git a/bridges/ScmbBridge.php b/bridges/ScmbBridge.php
index aefd29ff..2107aa3d 100644
--- a/bridges/ScmbBridge.php
+++ b/bridges/ScmbBridge.php
@@ -12,7 +12,7 @@ class ScmbBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM(self::URI)
 			or returnServerError('Could not request Se Coucher Moins Bete.');
 
-		foreach($html->find('article') as $article){
+		foreach($html->find('article') as $article) {
 			$item = array();
 			$item['uri'] = self::URI . $article->find('p.summary a', 0)->href;
 			$item['title'] = $article->find('header h1 a', 0)->innertext;
diff --git a/bridges/ScoopItBridge.php b/bridges/ScoopItBridge.php
index 21c7aa1b..997837da 100644
--- a/bridges/ScoopItBridge.php
+++ b/bridges/ScoopItBridge.php
@@ -21,7 +21,7 @@ class ScoopItBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM($link)
 			or returnServerError('Could not request ScoopIt. for : ' . $link);
 
-		foreach($html->find('div.post-view') as $element){
+		foreach($html->find('div.post-view') as $element) {
 			$item = array();
 			$item['uri'] = $element->find('a', 0)->href;
 			$item['title'] = preg_replace(
diff --git a/bridges/SensCritiqueBridge.php b/bridges/SensCritiqueBridge.php
index d8ba094d..7ac35f2c 100644
--- a/bridges/SensCritiqueBridge.php
+++ b/bridges/SensCritiqueBridge.php
@@ -36,10 +36,10 @@ class SensCritiqueBridge extends BridgeAbstract {
 
 	public function collectData(){
 		$categories = array();
-		foreach(self::PARAMETERS[$this->queriedContext] as $category => $properties){
-			if($this->getInput($category)){
+		foreach(self::PARAMETERS[$this->queriedContext] as $category => $properties) {
+			if($this->getInput($category)) {
 				$uri = self::URI;
-				switch($category){
+				switch($category) {
 				case 'm': $uri .= 'films/cette-semaine';
 				break;
 				case 's': $uri .= 'series/actualite';
@@ -63,11 +63,11 @@ class SensCritiqueBridge extends BridgeAbstract {
 	}
 
 	private function extractDataFromList($list){
-		if($list === null){
+		if($list === null) {
 			returnClientError('Cannot extract data from list');
 		}
 
-		foreach($list->find('li') as $movie){
+		foreach($list->find('li') as $movie) {
 			$item = array();
 			$item['author'] = htmlspecialchars_decode($movie->find('.elco-title a', 0)->plaintext, ENT_QUOTES)
 			. ' '
diff --git a/bridges/SexactuBridge.php b/bridges/SexactuBridge.php
index 8446a296..5bc552ab 100644
--- a/bridges/SexactuBridge.php
+++ b/bridges/SexactuBridge.php
@@ -24,11 +24,11 @@ class SexactuBridge extends BridgeAbstract {
 
 		$sexactu = $html->find('.container_sexactu', 0);
 		$rowList = $sexactu->find('.row');
-		foreach($rowList as $row){
+		foreach($rowList as $row) {
 			// only use first list as second one only contains pages numbers
 
 			$title = $row->find('.title', 0);
-			if($title){
+			if($title) {
 				$item = array();
 				$item['author'] = self::AUTHOR;
 				$item['title'] = $title->plaintext;
@@ -36,9 +36,9 @@ class SexactuBridge extends BridgeAbstract {
 				$uri = $title->$urlAttribute;
 				if($uri === false)
 					continue;
-				if(substr($uri, 0, 1) === 'h'){ // absolute uri
+				if(substr($uri, 0, 1) === 'h') { // absolute uri
 					$item['uri'] = $uri;
-				} else if(substr($uri, 0, 1) === '/'){ // domain relative url
+				} else if(substr($uri, 0, 1) === '/') { // domain relative url
 					$item['uri'] = self::URI . $uri;
 				} else {
 					$item['uri'] = $this->getURI() . $uri;
@@ -66,7 +66,7 @@ class SexactuBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOMCached($uri);
 
 		$content = $html->find('#article', 0);
-		if($content){
+		if($content) {
 			return $content;
 		}
 
diff --git a/bridges/ShanaprojectBridge.php b/bridges/ShanaprojectBridge.php
index cdf8ed25..e86f7729 100644
--- a/bridges/ShanaprojectBridge.php
+++ b/bridges/ShanaprojectBridge.php
@@ -110,7 +110,7 @@ class ShanaprojectBridge extends BridgeAbstract {
 		if(!$animes)
 			returnServerError('Could not find anime headers!');
 
-		foreach($animes as $anime){
+		foreach($animes as $anime) {
 			$item = array();
 			$item['title'] = $this->extractAnimeTitle($anime);
 			$item['author'] = $this->extractAnimeAuthor($anime);
diff --git a/bridges/SoundcloudBridge.php b/bridges/SoundcloudBridge.php
index ea80d56a..92d77daa 100644
--- a/bridges/SoundcloudBridge.php
+++ b/bridges/SoundcloudBridge.php
@@ -32,7 +32,7 @@ class SoundCloudBridge extends BridgeAbstract {
 			. self::CLIENT_ID
 		)) or returnServerError('No results for this user');
 
-		for($i = 0; $i < 10; $i++){
+		for($i = 0; $i < 10; $i++) {
 			$item = array();
 			$item['author'] = $tracks[$i]->user->username . ' - ' . $tracks[$i]->title;
 			$item['title'] = $tracks[$i]->user->username . ' - ' . $tracks[$i]->title;
@@ -55,7 +55,7 @@ class SoundCloudBridge extends BridgeAbstract {
 
 	}
 	public function getName(){
-		if(!is_null($this->getInput('u'))){
+		if(!is_null($this->getInput('u'))) {
 			return self::NAME . ' - ' . $this->getInput('u');
 		}
 
diff --git a/bridges/StripeAPIChangeLogBridge.php b/bridges/StripeAPIChangeLogBridge.php
index 721b46ad..22ef3816 100644
--- a/bridges/StripeAPIChangeLogBridge.php
+++ b/bridges/StripeAPIChangeLogBridge.php
@@ -10,7 +10,7 @@ class StripeAPIChangeLogBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM(self::URI)
 			or returnServerError('No results for Stripe API Changelog');
 
-		foreach($html->find('h3') as $change){
+		foreach($html->find('h3') as $change) {
 			$item = array();
 			$item['title'] = trim($change->plaintext);
 			$item['uri'] = self::URI . '#' . $item['title'];
diff --git a/bridges/SuperbWallpapersBridge.php b/bridges/SuperbWallpapersBridge.php
index 874f3abf..610dd323 100644
--- a/bridges/SuperbWallpapersBridge.php
+++ b/bridges/SuperbWallpapersBridge.php
@@ -38,12 +38,12 @@ class SuperbWallpapersBridge extends BridgeAbstract {
 
 		$lastpage = min($html->find('.paging .cpage', 0)->innertext(), ceil($max / 36));
 
-		for($page = 1; $page <= $lastpage; $page++){
+		for($page = 1; $page <= $lastpage; $page++) {
 			$link = self::URI . '/' . $category . '/' . $page . '.html';
 			$html = getSimpleHTMLDOM($link)
 				or returnServerError('No results for this query.');
 
-			foreach($html->find('.wpl .i a') as $element){
+			foreach($html->find('.wpl .i a') as $element) {
 				$thumbnail = $element->find('img', 0);
 
 				$item = array();
@@ -61,7 +61,7 @@ class SuperbWallpapersBridge extends BridgeAbstract {
 	}
 
 	public function getName(){
-		if(!is_null($this->getInput('c')) && !is_null($this->getInput('r'))){
+		if(!is_null($this->getInput('c')) && !is_null($this->getInput('r'))) {
 			return self::NAME . '- ' . $this->getInput('c') . ' [' . $this->getInput('r') . ']';
 		}
 
diff --git a/bridges/T411Bridge.php b/bridges/T411Bridge.php
index 040dd0d0..15cf628b 100644
--- a/bridges/T411Bridge.php
+++ b/bridges/T411Bridge.php
@@ -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;
 			}
 
diff --git a/bridges/TagBoardBridge.php b/bridges/TagBoardBridge.php
index d2f74bfe..b79847e6 100644
--- a/bridges/TagBoardBridge.php
+++ b/bridges/TagBoardBridge.php
@@ -21,12 +21,12 @@ class TagBoardBridge extends BridgeAbstract {
 			or returnServerError('Could not request TagBoard for : ' . $link);
 		$parsed_json = json_decode($html);
 
-		foreach($parsed_json->{'posts'} as $element){
+		foreach($parsed_json->{'posts'} as $element) {
 			$item = array();
 			$item['uri'] = $element->{'permalink'};
 			$item['title'] = $element->{'text'};
 			$thumbnailUri = $element->{'photos'}[0]->{'m'};
-			if(isset($thumbnailUri)){
+			if(isset($thumbnailUri)) {
 				$item['content'] = '<a href="'
 				. $item['uri']
 				. '"><img src="'
@@ -40,7 +40,7 @@ class TagBoardBridge extends BridgeAbstract {
 	}
 
 	public function getName(){
-		if(!is_null($this->getInput('u'))){
+		if(!is_null($this->getInput('u'))) {
 			return 'tagboard - ' . $this->getInput('u');
 		}
 
diff --git a/bridges/TheCodingLoveBridge.php b/bridges/TheCodingLoveBridge.php
index 13e34019..2a639e33 100644
--- a/bridges/TheCodingLoveBridge.php
+++ b/bridges/TheCodingLoveBridge.php
@@ -11,7 +11,7 @@ class TheCodingLoveBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM(self::URI)
 			or returnServerError('Could not request The Coding Love.');
 
-		foreach($html->find('div.post') as $element){
+		foreach($html->find('div.post') as $element) {
 			$item = array();
 			$temp = $element->find('h3 a', 0);
 
@@ -22,7 +22,7 @@ class TheCodingLoveBridge extends BridgeAbstract {
 
 			// retrieve .gif instead of static .jpg
 			$images = $temp->find('p.e img');
-			foreach($images as $image){
+			foreach($images as $image) {
 				$img_src = str_replace('.jpg', '.gif', $image->src);
 				$image->src = $img_src;
 			}
@@ -31,7 +31,7 @@ class TheCodingLoveBridge extends BridgeAbstract {
 			$auteur = $temp->find('i', 0);
 			$pos = strpos($auteur->innertext, 'by');
 
-			if($pos > 0){
+			if($pos > 0) {
 				$auteur = trim(str_replace('*/', '', substr($auteur->innertext, ($pos + 2))));
 				$item['author'] = $auteur;
 			}
diff --git a/bridges/TheHackerNewsBridge.php b/bridges/TheHackerNewsBridge.php
index c6163b1b..41066588 100644
--- a/bridges/TheHackerNewsBridge.php
+++ b/bridges/TheHackerNewsBridge.php
@@ -9,7 +9,7 @@ class TheHackerNewsBridge extends BridgeAbstract {
 	public function collectData(){
 
 		function stripWithDelimiters($string, $start, $end){
-			while(strpos($string, $start) !== false){
+			while(strpos($string, $start) !== false) {
 				$section_to_remove = substr($string, strpos($string, $start));
 				$section_to_remove = substr($section_to_remove, 0, strpos($section_to_remove, $end) + strlen($end));
 				$string = str_replace($section_to_remove, '', $string);
@@ -22,8 +22,8 @@ class TheHackerNewsBridge extends BridgeAbstract {
 			$open_tag = '<' . $tag_name;
 			$close_tag = '</' . $tag_name . '>';
 			$close_tag_length = strlen($close_tag);
-			if(strpos($tag_start, $open_tag) === 0){
-				while(strpos($string, $tag_start) !== false){
+			if(strpos($tag_start, $open_tag) === 0) {
+				while(strpos($string, $tag_start) !== false) {
 					$max_recursion = 100;
 					$section_to_remove = null;
 					$section_start = strpos($string, $tag_start);
@@ -51,8 +51,8 @@ class TheHackerNewsBridge extends BridgeAbstract {
 			or returnServerError('Could not request TheHackerNews: ' . $this->getURI());
 		$limit = 0;
 
-		foreach($html->find('article') as $element){
-			if($limit < 5){
+		foreach($html->find('article') as $element) {
+			if($limit < 5) {
 
 				$article_url = $element->find('a.entry-title', 0)->href;
 				$article_author = trim($element->find('span.vcard', 0)->plaintext);
diff --git a/bridges/ThePirateBayBridge.php b/bridges/ThePirateBayBridge.php
index 24110206..103737d0 100644
--- a/bridges/ThePirateBayBridge.php
+++ b/bridges/ThePirateBayBridge.php
@@ -45,7 +45,7 @@ class ThePirateBayBridge extends BridgeAbstract {
 				$guessedDate = explode('Uploaded ', $guessedDate)[1];
 				$guessedDate = explode(',', $guessedDate)[0];
 
-				if(count(explode(':', $guessedDate)) == 1){
+				if(count(explode(':', $guessedDate)) == 1) {
 					$guessedDate = strptime($guessedDate, '%m-%d&nbsp;%Y');
 					$timestamp = mktime(
 						0,
@@ -55,7 +55,7 @@ class ThePirateBayBridge extends BridgeAbstract {
 						$guessedDate['tm_mday'],
 						1900 + $guessedDate['tm_year']
 					);
-				} elseif(explode('&nbsp;', $guessedDate)[0] == 'Today'){
+				} elseif(explode('&nbsp;', $guessedDate)[0] == 'Today') {
 					$guessedDate = strptime(
 						explode('&nbsp;', $guessedDate)[1], '%H:%M'
 					);
@@ -68,7 +68,7 @@ class ThePirateBayBridge extends BridgeAbstract {
 						date('d'),
 						date('Y')
 					);
-				} elseif(explode('&nbsp;', $guessedDate)[0] == 'Y-day'){
+				} elseif(explode('&nbsp;', $guessedDate)[0] == 'Y-day') {
 					$guessedDate = strptime(
 						explode('&nbsp;', $guessedDate)[1], '%H:%M'
 					);
@@ -95,17 +95,17 @@ class ThePirateBayBridge extends BridgeAbstract {
 		}
 
 		$catBool = $this->getInput('cat_check');
-		if($catBool){
+		if($catBool) {
 			$catNum = $this->getInput('cat');
 		}
 		$critList = $this->getInput('crit');
 
 		$trustedBool = $this->getInput('trusted');
 		$keywordsList = explode(';', $this->getInput('q'));
-		foreach($keywordsList as $keywords){
-			switch($critList){
+		foreach($keywordsList as $keywords) {
+			switch($critList) {
 			case 'search':
-				if($catBool == false){
+				if($catBool == false) {
 					$html = getSimpleHTMLDOM(
 						self::URI .
 						'search/' .
@@ -143,11 +143,11 @@ class ThePirateBayBridge extends BridgeAbstract {
 			if ($html->find('table#searchResult', 0) == false)
 				returnServerError('No result for query ' . $keywords);
 
-			foreach($html->find('tr') as $element){
+			foreach($html->find('tr') as $element) {
 
 				if(!$trustedBool
 				|| !is_null($element->find('img[alt=VIP]', 0))
-				|| !is_null($element->find('img[alt=Trusted]', 0))){
+				|| !is_null($element->find('img[alt=Trusted]', 0))) {
 					$item = array();
 					$item['uri'] = $element->find('a', 3)->href;
 					$item['id'] = self::URI . $element->find('a.detLink', 0)->href;
diff --git a/bridges/TheTVDBBridge.php b/bridges/TheTVDBBridge.php
index 1804bc84..63af1ea4 100644
--- a/bridges/TheTVDBBridge.php
+++ b/bridges/TheTVDBBridge.php
@@ -55,7 +55,7 @@ class TheTVDBBridge extends BridgeAbstract {
 		$result = curl_exec($ch);
 		curl_close($ch);
 		$token_json = (array)json_decode($result);
-		if(isset($token_json['Error'])){
+		if(isset($token_json['Error'])) {
 			throw new Exception($token_json['Error']);
 			die;
 		}
@@ -78,7 +78,7 @@ class TheTVDBBridge extends BridgeAbstract {
 		$result = curl_exec($ch);
 		curl_close($ch);
 		$result_array = (array)json_decode($result);
-		if(isset($result_array['Error'])){
+		if(isset($result_array['Error'])) {
 			throw new Exception($result_array['Error']);
 			die;
 		}
@@ -118,7 +118,7 @@ class TheTVDBBridge extends BridgeAbstract {
 		//than 100 episodes in every season
 		$episodes = (array)$episodes['data'];
 		$episodes = array_slice($episodes, -$nbepisodemin, $nbepisodemin);
-		foreach($episodes as $episode){
+		foreach($episodes as $episode) {
 			$episodedata = array();
 			$episodedata['uri'] = $this->getURI()
 			. '?tab=episode&seriesid='
@@ -129,7 +129,7 @@ class TheTVDBBridge extends BridgeAbstract {
 			. $episode->id;
 
 			// check if the absoluteNumber exist
-			if(isset($episode->absoluteNumber)){
+			if(isset($episode->absoluteNumber)) {
 				$episodedata['title'] = 'S'
 				. $episode->airedSeason
 				. 'E'
@@ -166,7 +166,7 @@ class TheTVDBBridge extends BridgeAbstract {
 		$maxseason = $this->getLatestSeasonNumber($token, $serie_id);
 		$seriename = $this->getSerieName($token, $serie_id);
 		$season = $maxseason;
-		while(sizeof($episodelist) < $nbepisode && $season >= 1){
+		while(sizeof($episodelist) < $nbepisode && $season >= 1) {
 			$nbepisodetmp = $nbepisode - sizeof($episodelist);
 			$this->getSeasonEpisodes(
 				$token,
@@ -189,7 +189,7 @@ class TheTVDBBridge extends BridgeAbstract {
 				$episodelist,
 				$nbepisode
 			);
-		} catch(Exception $e){
+		} catch(Exception $e) {
 			unset($e);
 		}
 		// sort and keep the 10 last episodes, works bad with the netflix serie
diff --git a/bridges/Torrent9Bridge.php b/bridges/Torrent9Bridge.php
index a339e58e..742e777c 100644
--- a/bridges/Torrent9Bridge.php
+++ b/bridges/Torrent9Bridge.php
@@ -36,7 +36,7 @@ class Torrent9Bridge extends BridgeAbstract {
 
 	public function collectData(){
 
-		if($this->queriedContext === 'From search'){
+		if($this->queriedContext === 'From search') {
 			$request = str_replace(' ', '-', trim($this->getInput('q')));
 			$page = self::URI . '/search_torrent/' . urlencode($request) . '.html';
 		} else {
@@ -47,8 +47,8 @@ class Torrent9Bridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM($page)
 			or returnServerError('No results for this query.');
 
-		foreach($html->find('table', 0)->find('tr') as $episode){
-			if($episode->parent->tag == 'tbody'){
+		foreach($html->find('table', 0)->find('tr') as $episode) {
+			if($episode->parent->tag == 'tbody') {
 
 				$urlepisode = self::URI . $episode->find('a', 0)->getAttribute('href');
 
@@ -62,11 +62,11 @@ class Torrent9Bridge extends BridgeAbstract {
 				$item['pubdate'] = $this->getCachedDate($urlepisode);
 
 				$textefiche = $htmlepisode->find('.movie-information', 0)->find('p', 1);
-				if(isset($textefiche)){
+				if(isset($textefiche)) {
 					$item['content'] = $textefiche->text();
 				} else {
 					$p = $htmlepisode->find('.movie-information', 0)->find('p');
-					if(!empty($p)){
+					if(!empty($p)) {
 						$item['content'] = $htmlepisode->find('.movie-information', 0)->find('p', 0)->text();
 					}
 				}
@@ -81,7 +81,7 @@ class Torrent9Bridge extends BridgeAbstract {
 
 
 	public function getName(){
-		if(!is_null($this->getInput('q'))){
+		if(!is_null($this->getInput('q'))) {
 			return $this->getInput('q') . ' : ' . self::NAME;
 		}
 
diff --git a/bridges/TwitterBridge.php b/bridges/TwitterBridge.php
index 64fb653a..de2f00d3 100644
--- a/bridges/TwitterBridge.php
+++ b/bridges/TwitterBridge.php
@@ -48,7 +48,7 @@ class TwitterBridge extends BridgeAbstract {
 	);
 
 	public function getName(){
-		switch($this->queriedContext){
+		switch($this->queriedContext) {
 		case 'By keyword or hashtag':
 			$specific = 'search ';
 			$param = 'q';
@@ -63,7 +63,7 @@ class TwitterBridge extends BridgeAbstract {
 	}
 
 	public function getURI(){
-		switch($this->queriedContext){
+		switch($this->queriedContext) {
 		case 'By keyword or hashtag':
 			return self::URI
 			. 'search?q='
@@ -82,8 +82,8 @@ class TwitterBridge extends BridgeAbstract {
 		$html = '';
 
 		$html = getSimpleHTMLDOM($this->getURI());
-		if(!$html){
-			switch($this->queriedContext){
+		if(!$html) {
+			switch($this->queriedContext) {
 			case 'By keyword or hashtag':
 				returnServerError('No results for this query.');
 			case 'By username':
@@ -93,16 +93,16 @@ class TwitterBridge extends BridgeAbstract {
 
 		$hidePictures = $this->getInput('nopic');
 
-		foreach($html->find('div.js-stream-tweet') as $tweet){
+		foreach($html->find('div.js-stream-tweet') as $tweet) {
 
 			// Skip retweets?
 			if($this->getInput('noretweet')
-			&& $tweet->getAttribute('data-screen-name') !== $this->getInput('u')){
+			&& $tweet->getAttribute('data-screen-name') !== $this->getInput('u')) {
 				continue;
 			}
 
 			// remove 'invisible' content
-			foreach($tweet->find('.invisible') as $invisible){
+			foreach($tweet->find('.invisible') as $invisible) {
 				$invisible->outertext = '';
 			}
 
@@ -139,7 +139,7 @@ class TwitterBridge extends BridgeAbstract {
 
 			// Add picture to content
 			$picture_html = '';
-			if(!$hidePictures){
+			if(!$hidePictures) {
 				$picture_html = <<<EOD
 <a href="https://twitter.com/{$item['username']}">
 <img
@@ -154,7 +154,7 @@ EOD;
 			// Add embeded image to content
 			$image_html = '';
 			$image = $this->getImageURI($tweet);
-			if(!$this->getInput('noimg') && !is_null($image)){
+			if(!$this->getInput('noimg') && !is_null($image)) {
 				// add enclosures
 				$item['enclosures'] = array($image . ':orig');
 
@@ -182,7 +182,7 @@ EOD;
 
 			// add quoted tweet
 			$quotedTweet = $tweet->find('div.QuoteTweet', 0);
-			if($quotedTweet){
+			if($quotedTweet) {
 				// get tweet text
 				$cleanedQuotedTweet = str_replace(
 					'href="/',
@@ -196,7 +196,7 @@ EOD;
 				// Add embeded image to content
 				$quotedImage_html = '';
 				$quotedImage = $this->getQuotedImageURI($tweet);
-				if(!$this->getInput('noimg') && !is_null($quotedImage)){
+				if(!$this->getInput('noimg') && !is_null($quotedImage)) {
 					// add enclosures
 					$item['enclosures'] = array($quotedImage . ':orig');
 
@@ -228,15 +228,15 @@ EOD;
 
 	private function processEmojis($tweet){
 		// process emojis (reduce size)
-		foreach($tweet->find('img.Emoji') as $img){
+		foreach($tweet->find('img.Emoji') as $img) {
 			$img->style .= ' height: 1em;';
 		}
 	}
 
 	private function processContentLinks($tweet){
 		// processing content links
-		foreach($tweet->find('a') as $link){
-			if($link->hasAttribute('data-expanded-url')){
+		foreach($tweet->find('a') as $link) {
+			if($link->hasAttribute('data-expanded-url')) {
 				$link->href = $link->getAttribute('data-expanded-url');
 			}
 			$link->removeAttribute('data-expanded-url');
@@ -260,7 +260,7 @@ EOD;
 	private function getImageURI($tweet){
 		// Find media in tweet
 		$container = $tweet->find('div.AdaptiveMedia-container', 0);
-		if($container && $container->find('img', 0)){
+		if($container && $container->find('img', 0)) {
 			return $container->find('img', 0)->src;
 		}
 
@@ -270,7 +270,7 @@ EOD;
 	private function getQuotedImageURI($tweet){
 		// Find media in tweet
 		$container = $tweet->find('div.QuoteMedia-container', 0);
-		if($container && $container->find('img', 0)){
+		if($container && $container->find('img', 0)) {
 			return $container->find('img', 0)->src;
 		}
 
diff --git a/bridges/UnsplashBridge.php b/bridges/UnsplashBridge.php
index 3a3514b1..ee1040a9 100644
--- a/bridges/UnsplashBridge.php
+++ b/bridges/UnsplashBridge.php
@@ -32,12 +32,12 @@ class UnsplashBridge extends BridgeAbstract {
 		$quality = $this->getInput('q');
 		$lastpage = 1;
 
-		for($page = 1; $page <= $lastpage; $page++){
+		for($page = 1; $page <= $lastpage; $page++) {
 			$link = self::URI . '/grid?page=' . $page;
 			$html = getSimpleHTMLDOM($link)
 				or returnServerError('No results for this query.');
 
-			if($page === 1){
+			if($page === 1) {
 				preg_match(
 					'/=(\d+)$/',
 					$html->find('.pagination > a[!class]', -1)->href,
@@ -47,7 +47,7 @@ class UnsplashBridge extends BridgeAbstract {
 				$lastpage = min($matches[1], ceil($max / 40));
 			}
 
-			foreach($html->find('.photo') as $element){
+			foreach($html->find('.photo') as $element) {
 				$thumbnail = $element->find('img', 0);
 				$thumbnail->src = str_replace('https://', 'http://', $thumbnail->src);
 
diff --git a/bridges/UsbekEtRicaBridge.php b/bridges/UsbekEtRicaBridge.php
index 27d847a9..4d5ba169 100644
--- a/bridges/UsbekEtRicaBridge.php
+++ b/bridges/UsbekEtRicaBridge.php
@@ -31,11 +31,11 @@ class UsbekEtRicaBridge extends BridgeAbstract {
 
 		$articles = $html->find('div.details');
 
-		foreach($articles as $article){
+		foreach($articles as $article) {
 			$item = array();
 
 			$title = $article->find('div.card-title', 0);
-			if($title){
+			if($title) {
 				$item['title'] = $title->plaintext;
 			} else {
 				// Sometimes we get rubbish, ignore.
@@ -43,32 +43,32 @@ class UsbekEtRicaBridge extends BridgeAbstract {
 			}
 
 			$author = $article->find('div.author span', 0);
-			if($author){
+			if($author) {
 				$item['author'] = $author->plaintext;
 			}
 
 			$uri = $article->find('a.read', 0)->href;
-			if(substr($uri, 0, 1) === 'h'){ // absolute uri
+			if(substr($uri, 0, 1) === 'h') { // absolute uri
 				$item['uri'] = $uri;
 			} else { // relative uri
 				$item['uri'] = $this->getURI() . $uri;
 			}
 
-			if($fullarticle){
+			if($fullarticle) {
 				$content = $this->loadFullArticle($item['uri']);
 			}
 
-			if($fullarticle && !is_null($content)){
+			if($fullarticle && !is_null($content)) {
 				$item['content'] = $content;
 			} else {
 				$excerpt = $article->find('div.card-excerpt', 0);
-				if($excerpt){
+				if($excerpt) {
 					$item['content'] = $excerpt->plaintext;
 				}
 			}
 
 			$image = $article->find('div.card-img img', 0);
-			if($image){
+			if($image) {
 				$item['enclosures'] = array(
 					$image->src
 				);
@@ -76,7 +76,7 @@ class UsbekEtRicaBridge extends BridgeAbstract {
 
 			$this->items[] = $item;
 
-			if($limit > 0 && count($this->items) >= $limit){
+			if($limit > 0 && count($this->items) >= $limit) {
 				break;
 			}
 		}
@@ -91,7 +91,7 @@ class UsbekEtRicaBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOMCached($uri);
 
 		$content = $html->find('section.main', 0);
-		if($content){
+		if($content) {
 			return $this->replaceUriInHtmlElement($content);
 		}
 
diff --git a/bridges/ViadeoCompanyBridge.php b/bridges/ViadeoCompanyBridge.php
index 127c64a7..3f761880 100644
--- a/bridges/ViadeoCompanyBridge.php
+++ b/bridges/ViadeoCompanyBridge.php
@@ -22,9 +22,9 @@ class ViadeoCompanyBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM($link)
 			or returnServerError('Could not request Viadeo.');
 
-		foreach($html->find('//*[@id="company-newsfeed"]/ul/li') as $element){
+		foreach($html->find('//*[@id="company-newsfeed"]/ul/li') as $element) {
 			$title = $element->find('p', 0)->innertext;
-			if($title){
+			if($title) {
 				$item = array();
 				$item['uri'] = $link;
 				$item['title'] = mb_substr($element->find('p', 0)->innertext, 0, 100);
diff --git a/bridges/VineBridge.php b/bridges/VineBridge.php
index 52e1240a..61534a04 100644
--- a/bridges/VineBridge.php
+++ b/bridges/VineBridge.php
@@ -20,7 +20,7 @@ class VineBridge extends BridgeAbstract {
 	$html = getSimpleHTMLDOM($uri)
 		or returnServerError('No results for this query.');
 
-		foreach($html->find('.post') as $element){
+		foreach($html->find('.post') as $element) {
 			$a = $element->find('a', 0);
 			$a->href = str_replace('https://', 'http://', $a->href);
 			$time = strtotime(ltrim($element->find('p', 0)->plaintext, ' Uploaded at '));
diff --git a/bridges/VkBridge.php b/bridges/VkBridge.php
index 9c5d002a..9981da12 100644
--- a/bridges/VkBridge.php
+++ b/bridges/VkBridge.php
@@ -16,7 +16,7 @@ class VkBridge extends BridgeAbstract {
 	);
 
 	public function getURI(){
-		if(!is_null($this->getInput('u'))){
+		if(!is_null($this->getInput('u'))) {
 			return static::URI . urlencode($this->getInput('u'));
 		}
 
@@ -33,15 +33,15 @@ class VkBridge extends BridgeAbstract {
 		$text_html = iconv('windows-1251', 'utf-8', $text_html);
 		$html = str_get_html($text_html);
 
-		foreach($html->find('.post') as $post){
+		foreach($html->find('.post') as $post) {
 
-			if(is_object($post->find('a.wall_post_more', 0))){
+			if(is_object($post->find('a.wall_post_more', 0))) {
 				//delete link "show full" in content
 				$post->find('a.wall_post_more', 0)->outertext = '';
 			}
 			$item = array();
 			$item['content'] = strip_tags(backgroundToImg($post->find('div.wall_text', 0)->innertext), '<br><img>');
-			if(is_object($post->find('a.page_media_link_title', 0))){
+			if(is_object($post->find('a.page_media_link_title', 0))) {
 				$link = $post->find('a.page_media_link_title', 0)->getAttribute('href');
 
 				//external link in the post
@@ -50,7 +50,7 @@ class VkBridge extends BridgeAbstract {
 			}
 
 			//get video on post
-			if(is_object($post->find('span.post_video_title_content', 0))){
+			if(is_object($post->find('span.post_video_title_content', 0))) {
 				$titleVideo = $post->find('span.post_video_title_content', 0)->plaintext;
 				$linkToVideo = self::URI . $post->find('a.page_post_thumb_video', 0)->getAttribute('href');
 				$item['content'] .= "\n\r {$titleVideo}: {$linkToVideo}";
diff --git a/bridges/WallpaperStopBridge.php b/bridges/WallpaperStopBridge.php
index 87be0d15..3578e714 100644
--- a/bridges/WallpaperStopBridge.php
+++ b/bridges/WallpaperStopBridge.php
@@ -35,7 +35,7 @@ class WallpaperStopBridge extends BridgeAbstract {
 		$max = $this->getInput('m');
 		$lastpage = 1;
 
-		for($page = 1; $page <= $lastpage; $page++){
+		for($page = 1; $page <= $lastpage; $page++) {
 			$link = self::URI
 			. '/'
 			. $category
@@ -48,14 +48,14 @@ class WallpaperStopBridge extends BridgeAbstract {
 			$html = getSimpleHTMLDOM($link)
 				or returnServerError('No results for this query.');
 
-			if($page === 1){
+			if($page === 1) {
 				preg_match('/-(\d+)\.html$/', $html->find('.pagination > .last', 0)->href, $matches);
 				$lastpage = min($matches[1], ceil($max / 20));
 			}
 
-			foreach($html->find('article.item') as $element){
+			foreach($html->find('article.item') as $element) {
 				$wplink = $element->getAttribute('data-permalink');
-				if(preg_match('%^' . self::URI . '/(.+)/([^/]+)-(\d+)\.html$%', $wplink, $matches)){
+				if(preg_match('%^' . self::URI . '/(.+)/([^/]+)-(\d+)\.html$%', $wplink, $matches)) {
 					$thumbnail = $element->find('img', 0);
 
 					$item = array();
@@ -92,7 +92,7 @@ class WallpaperStopBridge extends BridgeAbstract {
 	}
 
 	public function getName(){
-		if(!is_null($this->getInput('s')) && !is_null($this->getInput('c')) && !is_null($this->getInput('r'))){
+		if(!is_null($this->getInput('s')) && !is_null($this->getInput('c')) && !is_null($this->getInput('r'))) {
 			$subcategory = $this->getInput('s');
 			return 'WallpaperStop - '
 			. $this->getInput('c')
diff --git a/bridges/WeLiveSecurityBridge.php b/bridges/WeLiveSecurityBridge.php
index c2e4308c..466a4b28 100644
--- a/bridges/WeLiveSecurityBridge.php
+++ b/bridges/WeLiveSecurityBridge.php
@@ -7,7 +7,7 @@ class WeLiveSecurityBridge extends FeedExpander {
 	const DESCRIPTION = 'Returns the newest articles.';
 
 	private function stripWithDelimiters($string, $start, $end){
-		while(strpos($string, $start) !== false){
+		while(strpos($string, $start) !== false) {
 			$section_to_remove = substr($string, strpos($string, $start));
 			$section_to_remove = substr($section_to_remove, 0, strpos($section_to_remove, $end) + strlen($end));
 			$string = str_replace($section_to_remove, '', $string);
@@ -21,7 +21,7 @@ class WeLiveSecurityBridge extends FeedExpander {
 		$item = parent::parseItem($item);
 
 		$article_html = getSimpleHTMLDOMCached($item['uri']);
-		if(!$article_html){
+		if(!$article_html) {
 			$item['content'] .= '<p>Could not request ' . $this->getName() . ': ' . $item['uri'] . '</p>';
 			return $item;
 		}
diff --git a/bridges/WebfailBridge.php b/bridges/WebfailBridge.php
index a1060f4f..2a637407 100644
--- a/bridges/WebfailBridge.php
+++ b/bridges/WebfailBridge.php
@@ -49,7 +49,7 @@ class WebfailBridge extends BridgeAbstract {
 		$type = array_search($this->getInput('type'),
 			self::PARAMETERS[$this->queriedContext]['type']['values']);
 
-		switch(strtolower($type)){
+		switch(strtolower($type)) {
 		case 'facebook':
 		case 'videos':
 			$this->extractNews($html, $type);
@@ -65,14 +65,14 @@ class WebfailBridge extends BridgeAbstract {
 
 	private function extractNews($html, $type){
 		$news = $html->find('#main', 0)->find('a.wf-list-news');
-		foreach($news as $element){
+		foreach($news as $element) {
 			$item = array();
 			$item['title'] = $this->fixTitle($element->find('div.wf-news-title', 0)->innertext);
 			$item['uri'] = $this->getURI() . $element->href;
 
 			$img = $element->find('img.wf-image', 0)->src;
 			// Load high resolution image for 'facebook'
-			switch(strtolower($type)){
+			switch(strtolower($type)) {
 			case 'facebook':
 				$img = $this->getImageHiResUri($item['uri']);
 				break;
@@ -80,7 +80,7 @@ class WebfailBridge extends BridgeAbstract {
 			}
 
 			$description = '';
-			if(!is_null($element->find('div.wf-news-description', 0))){
+			if(!is_null($element->find('div.wf-news-description', 0))) {
 				$description = $element->find('div.wf-news-description', 0)->innertext;
 			}
 
@@ -98,19 +98,19 @@ class WebfailBridge extends BridgeAbstract {
 
 	private function extractArticle($html){
 		$articles = $html->find('article');
-		foreach($articles as $article){
+		foreach($articles as $article) {
 			$item = array();
 			$item['title'] = $this->fixTitle($article->find('a', 1)->innertext);
 
 			// Images, videos and gifs are provided in their own unique way
-			if(!is_null($article->find('img.wf-image', 0))){ // Image type
+			if(!is_null($article->find('img.wf-image', 0))) { // Image type
 				$item['uri'] = $this->getURI() . $article->find('a', 2)->href;
 				$item['content'] = '<a href="'
 				. $item['uri']
 				. '"><img src="'
 				. $article->find('img.wf-image', 0)->src
 				. '"></a>';
-			} elseif(!is_null($article->find('div.wf-video', 0))){ // Video type
+			} elseif(!is_null($article->find('div.wf-video', 0))) { // Video type
 				$videoId = $this->getVideoId($article->find('div.wf-play', 0)->onclick);
 				$item['uri'] = 'https://youtube.com/watch?v=' . $videoId;
 				$item['content'] = '<a href="'
@@ -118,7 +118,7 @@ class WebfailBridge extends BridgeAbstract {
 				. '"><img src="http://img.youtube.com/vi/'
 				. $videoId
 				. '/0.jpg"></a>';
-			} elseif(!is_null($article->find('video[id*=gif-]', 0))){ // Gif type
+			} elseif(!is_null($article->find('video[id*=gif-]', 0))) { // Gif type
 				$item['uri'] = $this->getURI() . $article->find('a', 2)->href;
 				$item['content'] = '<video controls src="'
 				. $article->find('video[id*=gif-]', 0)->src
diff --git a/bridges/WhydBridge.php b/bridges/WhydBridge.php
index be859150..accdb759 100644
--- a/bridges/WhydBridge.php
+++ b/bridges/WhydBridge.php
@@ -18,7 +18,7 @@ class WhydBridge extends BridgeAbstract {
 
 	public function collectData(){
 		$html = '';
-		if(strlen(preg_replace("/[^0-9a-f]/", '', $this->getInput('u'))) == 24){
+		if(strlen(preg_replace("/[^0-9a-f]/", '', $this->getInput('u'))) == 24) {
 			// is input the userid ?
 			$html = getSimpleHTMLDOM(
 				self::URI . 'u/' . preg_replace("/[^0-9a-f]/", '', $this->getInput('u'))
@@ -28,8 +28,8 @@ class WhydBridge extends BridgeAbstract {
 				self::URI . 'search?q=' . urlencode($this->getInput('u'))
 			) or returnServerError('No results for this query.');
 
-			for($j = 0; $j < 5; $j++){
-				if(strtolower($html->find('div.user', $j)->find('a', 0)->plaintext) == strtolower($this->getInput('u'))){
+			for($j = 0; $j < 5; $j++) {
+				if(strtolower($html->find('div.user', $j)->find('a', 0)->plaintext) == strtolower($this->getInput('u'))) {
 					$html = getSimpleHTMLDOM(
 						self::URI . $html->find('div.user', $j)->find('a', 0)->getAttribute('href')
 					) or returnServerError('No results for this query');
@@ -39,7 +39,7 @@ class WhydBridge extends BridgeAbstract {
 		}
 		$this->userName = $html->find('div#profileTop', 0)->find('h1', 0)->plaintext;
 
-		for($i = 0; $i < 10; $i++){
+		for($i = 0; $i < 10; $i++) {
 			$track = $html->find('div.post', $i);
 			$item = array();
 			$item['author'] = $track->find('h2', 0)->plaintext;
diff --git a/bridges/WikiLeaksBridge.php b/bridges/WikiLeaksBridge.php
index 5533d68c..c5b9bb69 100644
--- a/bridges/WikiLeaksBridge.php
+++ b/bridges/WikiLeaksBridge.php
@@ -39,7 +39,7 @@ class WikiLeaksBridge extends BridgeAbstract {
 		$html = getSimpleHTMLDOM($this->getURI());
 
 		// News are presented differently
-		switch($this->getInput('category')){
+		switch($this->getInput('category')) {
 			case '-News-':
 				$this->loadNewsItems($html);
 				break;
@@ -49,7 +49,7 @@ class WikiLeaksBridge extends BridgeAbstract {
 	}
 
 	public function getURI(){
-		if(!is_null($this->getInput('category'))){
+		if(!is_null($this->getInput('category'))) {
 			return static::URI . '/' . $this->getInput('category') . '.html';
 		}
 
@@ -57,13 +57,13 @@ class WikiLeaksBridge extends BridgeAbstract {
 	}
 
 	public function getName(){
-		if(!is_null($this->getInput('category'))){
+		if(!is_null($this->getInput('category'))) {
 			$category = array_search(
 				$this->getInput('category'),
 				static::PARAMETERS[0]['category']['values']
 			);
 
-			if($category === false){
+			if($category === false) {
 				$category = array_search(
 					$this->getInput('category'),
 					static::PARAMETERS[0]['category']['values']['Leaks']
@@ -79,11 +79,11 @@ class WikiLeaksBridge extends BridgeAbstract {
 	private function loadNewsItems($html){
 		$articles = $html->find('div.news-articles ul li');
 
-		if(is_null($articles) || count($articles) === 0){
+		if(is_null($articles) || count($articles) === 0) {
 			return;
 		}
 
-		foreach($articles as $article){
+		foreach($articles as $article) {
 			$item = array();
 
 			$item['title'] = $article->find('h3', 0)->plaintext;
@@ -98,11 +98,11 @@ class WikiLeaksBridge extends BridgeAbstract {
 	private function loadLeakItems($html){
 		$articles = $html->find('li.tile');
 
-		if(is_null($articles) || count($articles) === 0){
+		if(is_null($articles) || count($articles) === 0) {
 			return;
 		}
 
-		foreach($articles as $article){
+		foreach($articles as $article) {
 			$item = array();
 
 			$item['title'] = $article->find('h2', 0)->plaintext;
@@ -110,7 +110,7 @@ class WikiLeaksBridge extends BridgeAbstract {
 
 			$teaser = static::URI . '/' . $article->find('div.teaser img', 0)->src;
 
-			if($this->getInput('teaser')){
+			if($this->getInput('teaser')) {
 				$item['content'] = '<img src="'
 				. $teaser
 				. '" /><p>'
diff --git a/bridges/WikipediaBridge.php b/bridges/WikipediaBridge.php
index 17559b56..6b534407 100644
--- a/bridges/WikipediaBridge.php
+++ b/bridges/WikipediaBridge.php
@@ -43,7 +43,7 @@ class WikipediaBridge extends BridgeAbstract {
 	));
 
 	public function getURI(){
-		if(!is_null($this->getInput('language'))){
+		if(!is_null($this->getInput('language'))) {
 			return 'https://'
 			. strtolower($this->getInput('language'))
 			. '.wikipedia.org';
@@ -53,7 +53,7 @@ class WikipediaBridge extends BridgeAbstract {
 	}
 
 	public function getName(){
-		switch($this->getInput('subject')){
+		switch($this->getInput('subject')) {
 			case 'tfa':
 				$subject = WIKIPEDIA_SUBJECT_TFA;
 				break;
@@ -63,7 +63,7 @@ class WikipediaBridge extends BridgeAbstract {
 			default: return parent::getName();
 		}
 
-		switch($subject){
+		switch($subject) {
 			case WIKIPEDIA_SUBJECT_TFA:
 				$name = 'Today\'s featured article from '
 				. strtolower($this->getInput('language'))
@@ -85,7 +85,7 @@ class WikipediaBridge extends BridgeAbstract {
 
 	public function collectData(){
 
-		switch($this->getInput('subject')){
+		switch($this->getInput('subject')) {
 			case 'tfa':
 				$subject = WIKIPEDIA_SUBJECT_TFA;
 				break;
@@ -148,8 +148,8 @@ class WikipediaBridge extends BridgeAbstract {
 		// The title and URI of the article can be found in an anchor containing
 		// the string '...' in most wikis ('full article ...')
 		$target = $element->find('p/a', $anchorFallbackIndex);
-		foreach($element->find('//a') as $anchor){
-			if(strpos($anchor->innertext, $anchorText) !== false){
+		foreach($element->find('//a') as $anchor) {
+			if(strpos($anchor->innertext, $anchorText) !== false) {
 				$target = $anchor;
 				break;
 			}
@@ -171,7 +171,7 @@ class WikipediaBridge extends BridgeAbstract {
 	* Adds a new item to $items using a generic operation (should work for most (all?) wikis)
 	*/
 	private function addDidYouKnowGeneric($element, $fullArticle){
-		foreach($element->find('ul', 0)->find('li') as $entry){
+		foreach($element->find('ul', 0)->find('li') as $entry) {
 			$item = array();
 
 			// We can only use the first anchor, there is no way of finding the 'correct' one if there are multiple
@@ -216,7 +216,7 @@ class WikipediaBridge extends BridgeAbstract {
 	* Implementation for de.wikipedia.org
 	*/
 	private function getContentsDe($html, $subject, $fullArticle){
-		switch($subject){
+		switch($subject) {
 			case WIKIPEDIA_SUBJECT_TFA:
 				$element = $html->find('div[id=mf-tfa]', 0);
 				$this->addTodaysFeaturedArticleGeneric($element, $fullArticle);
@@ -234,7 +234,7 @@ class WikipediaBridge extends BridgeAbstract {
 	* Implementation for fr.wikipedia.org
 	*/
 	private function getContentsFr($html, $subject, $fullArticle){
-		switch($subject){
+		switch($subject) {
 			case WIKIPEDIA_SUBJECT_TFA:
 				$element = $html->find('div[class=accueil_2017_cadre]', 0);
 				$this->addTodaysFeaturedArticleGeneric($element, $fullArticle, 'Lire la suite');
@@ -252,7 +252,7 @@ class WikipediaBridge extends BridgeAbstract {
 	* Implementation for en.wikipedia.org
 	*/
 	private function getContentsEn($html, $subject, $fullArticle){
-		switch($subject){
+		switch($subject) {
 			case WIKIPEDIA_SUBJECT_TFA:
 				$element = $html->find('div[id=mp-tfa]', 0);
 				$this->addTodaysFeaturedArticleGeneric($element, $fullArticle);
@@ -270,7 +270,7 @@ class WikipediaBridge extends BridgeAbstract {
 	* Implementation for eo.wikipedia.org
 	*/
 	private function getContentsEo($html, $subject, $fullArticle){
-		switch($subject){
+		switch($subject) {
 			case WIKIPEDIA_SUBJECT_TFA:
 				$element = $html->find('div[id=mf-artikolo-de-la-semajno]', 0);
 				$this->addTodaysFeaturedArticleGeneric($element, $fullArticle);
@@ -288,7 +288,7 @@ class WikipediaBridge extends BridgeAbstract {
 	* Implementation for nl.wikipedia.org
 	*/
 	private function getContentsNl($html, $subject, $fullArticle){
-		switch($subject){
+		switch($subject) {
 			case WIKIPEDIA_SUBJECT_TFA:
 				$element = $html->find('div[id=mf-uitgelicht]', 0);
 				$this->addTodaysFeaturedArticleGeneric($element, $fullArticle, 'Lees meer');
diff --git a/bridges/WordPressBridge.php b/bridges/WordPressBridge.php
index 954325e6..b367adc9 100644
--- a/bridges/WordPressBridge.php
+++ b/bridges/WordPressBridge.php
@@ -26,7 +26,7 @@ class WordPressBridge extends FeedExpander {
 		$article_html = getSimpleHTMLDOMCached($item['uri']);
 
 		$article = null;
-		switch(true){
+		switch(true) {
 		case !is_null($article_html->find('article', 0)):
 			// most common content div
 			$article = $article_html->find('article', 0);
@@ -46,7 +46,7 @@ class WordPressBridge extends FeedExpander {
 			break;
 		}
 
-		if(!is_null($article)){
+		if(!is_null($article)) {
 			$item['content'] = $this->clearContent($article->innertext);
 		}
 
@@ -55,20 +55,20 @@ class WordPressBridge extends FeedExpander {
 
 	public function getURI(){
 		$url = $this->getInput('url');
-		if(empty($url)){
+		if(empty($url)) {
 			$url = parent::getURI();
 		}
 		return $url;
 	}
 
 	public function collectData(){
-		if($this->getInput('url') && substr($this->getInput('url'), 0, strlen('http')) !== 'http'){
+		if($this->getInput('url') && substr($this->getInput('url'), 0, strlen('http')) !== 'http') {
 			// just in case someone find a way to access local files by playing with the url
 			returnClientError('The url parameter must either refer to http or https protocol.');
 		}
 		try{
 			$this->collectExpandableDatas($this->getURI() . '/feed/atom/');
-		}catch (HttpException $e){
+		} catch (HttpException $e) {
 			$this->collectExpandableDatas($this->getURI() . '/?feed=atom');
 		}
 
diff --git a/bridges/WordPressPluginUpdateBridge.php b/bridges/WordPressPluginUpdateBridge.php
index a57ba1c4..cb57df84 100644
--- a/bridges/WordPressPluginUpdateBridge.php
+++ b/bridges/WordPressPluginUpdateBridge.php
@@ -66,7 +66,7 @@ class WordPressPluginUpdateBridge extends BridgeAbstract {
 
 
 	public function getName(){
-		if(!is_null($this->getInput('q'))){
+		if(!is_null($this->getInput('q'))) {
 			return $this->getInput('q') . ' : ' . self::NAME;
 		}
 
diff --git a/bridges/WorldOfTanksBridge.php b/bridges/WorldOfTanksBridge.php
index a894f6e9..f783e291 100644
--- a/bridges/WorldOfTanksBridge.php
+++ b/bridges/WorldOfTanksBridge.php
@@ -29,7 +29,7 @@ class WorldOfTanksBridge extends BridgeAbstract {
 	private $title = '';
 
 	public function getURI(){
-		if(!is_null($this->getInput('lang'))){
+		if(!is_null($this->getInput('lang'))) {
 			$lang = $this->getInput('lang');
 			$uri = self::URI . $lang . '/news/';
 			if(!empty($this->getInput('category'))) {
@@ -51,7 +51,7 @@ class WorldOfTanksBridge extends BridgeAbstract {
 		debugMessage("loaded HTML from " . $this->getURI());
 		// customize name
 		$this->title = $html->find('title', 0)->innertext;
-		foreach($html->find('.b-imgblock_ico') as $infoLink){
+		foreach($html->find('.b-imgblock_ico') as $infoLink) {
 			$this->parseLine($infoLink);
 		}
 	}
diff --git a/bridges/YoutubeBridge.php b/bridges/YoutubeBridge.php
index 117b84ad..dab32529 100644
--- a/bridges/YoutubeBridge.php
+++ b/bridges/YoutubeBridge.php
@@ -70,7 +70,7 @@ class YoutubeBridge extends BridgeAbstract {
 	}
 
 	private function ytBridgeParseXmlFeed($xml) {
-		foreach($xml->find('entry') as $element){
+		foreach($xml->find('entry') as $element) {
 			$title = $this->ytBridgeFixTitle($element->find('title', 0)->plaintext);
 			$author = $element->find('name', 0)->plaintext;
 			$desc = $element->find('media:description', 0)->innertext;
@@ -92,14 +92,14 @@ class YoutubeBridge extends BridgeAbstract {
 	private function ytBridgeParseHtmlListing($html, $element_selector, $title_selector){
 		$limit = 10;
 		$count = 0;
-		foreach($html->find($element_selector) as $element){
-			if($count < $limit){
+		foreach($html->find($element_selector) as $element) {
+			if($count < $limit) {
 				$author = '';
 				$desc = '';
 				$time = 0;
 				$vid = str_replace('/watch?v=', '', $element->find('a', 0)->href);
 				$title = $this->ytBridgeFixTitle($element->find($title_selector, 0)->plaintext);
-				if($title != '[Private Video]'){
+				if($title != '[Private Video]') {
 					$this->ytBridgeQueryVideoInfo($vid, $author, $desc, $time);
 					$this->ytBridgeAddItem($vid, $title, $author, $desc, $time);
 					$count++;
@@ -134,32 +134,32 @@ class YoutubeBridge extends BridgeAbstract {
 		$url_feed = '';
 		$url_listing = '';
 
-		if($this->getInput('u')){ /* User and Channel modes */
+		if($this->getInput('u')) { /* User and Channel modes */
 			$this->request = $this->getInput('u');
 			$url_feed = self::URI . 'feeds/videos.xml?user=' . urlencode($this->request);
 			$url_listing = self::URI . 'user/' . urlencode($this->request) . '/videos';
-		} elseif($this->getInput('c')){
+		} elseif($this->getInput('c')) {
 			$this->request = $this->getInput('c');
 			$url_feed = self::URI . 'feeds/videos.xml?channel_id=' . urlencode($this->request);
 			$url_listing = self::URI . 'channel/' . urlencode($this->request) . '/videos';
 		}
 
-		if(!empty($url_feed) && !empty($url_listing)){
-			if($xml = $this->ytGetSimpleHTMLDOM($url_feed)){
+		if(!empty($url_feed) && !empty($url_listing)) {
+			if($xml = $this->ytGetSimpleHTMLDOM($url_feed)) {
 				$this->ytBridgeParseXmlFeed($xml);
-			} elseif($html = $this->ytGetSimpleHTMLDOM($url_listing)){
+			} elseif($html = $this->ytGetSimpleHTMLDOM($url_listing)) {
 				$this->ytBridgeParseHtmlListing($html, 'li.channels-content-item', 'h3');
 			} else {
 				returnServerError("Could not request YouTube. Tried:\n - $url_feed\n - $url_listing");
 			}
-		} elseif($this->getInput('p')){ /* playlist mode */
+		} elseif($this->getInput('p')) { /* playlist mode */
 			$this->request = $this->getInput('p');
 			$url_listing = self::URI . 'playlist?list=' . urlencode($this->request);
 			$html = $this->ytGetSimpleHTMLDOM($url_listing)
 				or returnServerError("Could not request YouTube. Tried:\n - $url_listing");
 			$this->ytBridgeParseHtmlListing($html, 'tr.pl-video', '.pl-video-title a');
 			$this->request = 'Playlist: ' . str_replace(' - YouTube', '', $html->find('title', 0)->plaintext);
-		} elseif($this->getInput('s')){ /* search mode */
+		} elseif($this->getInput('s')) { /* search mode */
 			$this->request = $this->getInput('s');
 			$page = 1;
 			if($this->getInput('pa'))
diff --git a/bridges/ZDNetBridge.php b/bridges/ZDNetBridge.php
index 5fb7e306..86e4b494 100644
--- a/bridges/ZDNetBridge.php
+++ b/bridges/ZDNetBridge.php
@@ -168,7 +168,7 @@ class ZDNetBridge extends BridgeAbstract {
 		}
 
 		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;
@@ -178,7 +178,7 @@ class ZDNetBridge extends BridgeAbstract {
 		}
 
 		function stripWithDelimiters($string, $start, $end){
-			while(strpos($string, $start) !== false){
+			while(strpos($string, $start) !== false) {
 				$section_to_remove = substr($string, strpos($string, $start));
 				$section_to_remove = substr($section_to_remove, 0, strpos($section_to_remove, $end) + strlen($end));
 				$string = str_replace($section_to_remove, '', $string);
@@ -191,8 +191,8 @@ class ZDNetBridge extends BridgeAbstract {
 			$open_tag = '<' . $tag_name;
 			$close_tag = '</' . $tag_name . '>';
 			$close_tag_length = strlen($close_tag);
-			if(strpos($tag_start, $open_tag) === 0){
-				while(strpos($string, $tag_start) !== false){
+			if(strpos($tag_start, $open_tag) === 0) {
+				while(strpos($string, $tag_start) !== false) {
 					$max_recursion = 100;
 					$section_to_remove = null;
 					$section_start = strpos($string, $tag_start);
@@ -218,7 +218,7 @@ class ZDNetBridge extends BridgeAbstract {
 
 		$baseUri = self::URI;
 		$feed = $this->getInput('feed');
-		if(strpos($feed, 'downloads!') !== false){
+		if(strpos($feed, 'downloads!') !== false) {
 			$feed = str_replace('downloads!', '', $feed);
 			$baseUri = str_replace('www.', 'downloads.', $baseUri);
 		}
@@ -227,8 +227,8 @@ class ZDNetBridge extends BridgeAbstract {
 			or returnServerError('Could not request ZDNet: ' . $url);
 		$limit = 0;
 
-		foreach($html->find('item') as $element){
-			if($limit < 10){
+		foreach($html->find('item') as $element) {
+			if($limit < 10) {
 				$article_url = preg_replace(
 					'/([^#]+)#ftag=.*/',
 					'$1',
@@ -242,11 +242,11 @@ class ZDNetBridge extends BridgeAbstract {
 				$article = getSimpleHTMLDOM($article_url)
 					or returnServerError('Could not request ZDNet: ' . $article_url);
 
-				if(!empty($article_author)){
+				if(!empty($article_author)) {
 					$author = $article_author;
 				} else {
 					$author = $article->find('meta[name=author]', 0);
-					if(is_object($author)){
+					if(is_object($author)) {
 						$author = $author->content;
 					} else {
 						$author = 'ZDNet';
@@ -254,7 +254,7 @@ class ZDNetBridge extends BridgeAbstract {
 				}
 
 				$thumbnail = $article->find('meta[itemprop=image]', 0);
-				if(is_object($thumbnail)){
+				if(is_object($thumbnail)) {
 					$thumbnail = $thumbnail->content;
 				} else {
 					$thumbnail = '';
@@ -269,14 +269,14 @@ class ZDNetBridge extends BridgeAbstract {
 					'<div data-shortcode',
 					'<div id="sharethrough',
 					'<div id="inpage-video'
-				) as $div_start){
+				) as $div_start) {
 					$contents = stripRecursiveHtmlSection($contents, 'div', $div_start);
 				}
 				$contents = stripWithDelimiters($contents, '<script', '</script>');
 				$contents = stripWithDelimiters($contents, '<meta itemprop="image"', '>');
 				$contents = trim(stripWithDelimiters($contents, '<section class="sharethrough-top', '</section>'));
 				$content_img = strpos($contents, '<img'); //Look for first image
-				if (($content_img !== false && $content_img < 512) || $thumbnail == ''){
+				if (($content_img !== false && $content_img < 512) || $thumbnail == '') {
 					$content_img = ''; //Image already present on article beginning or no thumbnail
 				} else {
 					$content_img = '<p><img src="'.$thumbnail.'" /></p>'; //Include thumbnail
diff --git a/caches/FileCache.php b/caches/FileCache.php
index 59bced90..20323aa0 100644
--- a/caches/FileCache.php
+++ b/caches/FileCache.php
@@ -25,7 +25,7 @@ class FileCache implements CacheInterface {
 
 	public function getTime(){
 		$cacheFile = $this->getCacheFile();
-		if(file_exists($cacheFile)){
+		if(file_exists($cacheFile)) {
 			return filemtime($cacheFile);
 		}
 
@@ -34,16 +34,16 @@ class FileCache implements CacheInterface {
 
 	public function purgeCache($duration){
 		$cachePath = $this->getPath();
-		if(file_exists($cachePath)){
+		if(file_exists($cachePath)) {
 			$cacheIterator = new RecursiveIteratorIterator(
 			new RecursiveDirectoryIterator($cachePath),
 			RecursiveIteratorIterator::CHILD_FIRST
 			);
 
-			foreach($cacheIterator as $cacheFile){
+			foreach($cacheIterator as $cacheFile) {
 				if(in_array($cacheFile->getBasename(), array('.', '..', '.gitkeep')))
 					continue;
-				elseif($cacheFile->isFile()){
+				elseif($cacheFile->isFile()) {
 					if(filemtime($cacheFile->getPathname()) < time() - $duration)
 						unlink($cacheFile->getPathname());
 				}
@@ -56,7 +56,7 @@ class FileCache implements CacheInterface {
 	* @return self
 	*/
 	public function setPath($path){
-		if(is_null($path) || !is_string($path)){
+		if(is_null($path) || !is_string($path)) {
 			throw new \Exception('The given path is invalid!');
 		}
 
@@ -88,7 +88,7 @@ class FileCache implements CacheInterface {
 	* @return string Cache path
 	*/
 	protected function getPath(){
-		if(is_null($this->path)){
+		if(is_null($this->path)) {
 			throw new \Exception('Call "setPath" first!');
 		}
 
@@ -108,7 +108,7 @@ class FileCache implements CacheInterface {
 	* return string
 	*/
 	protected function getCacheName(){
-		if(is_null($this->param)){
+		if(is_null($this->param)) {
 			throw new \Exception('Call "setParameters" first!');
 		}
 
diff --git a/formats/AtomFormat.php b/formats/AtomFormat.php
index bb9abb5b..66f0d2b4 100644
--- a/formats/AtomFormat.php
+++ b/formats/AtomFormat.php
@@ -20,7 +20,7 @@ class AtomFormat extends FormatAbstract{
 		$uri = $this->xml_encode($uri);
 
 		$entries = '';
-		foreach($this->getItems() as $item){
+		foreach($this->getItems() as $item) {
 			$entryAuthor = isset($item['author']) ? $this->xml_encode($item['author']) : '';
 			$entryTitle = isset($item['title']) ? $this->xml_encode($item['title']) : '';
 			$entryUri = isset($item['uri']) ? $this->xml_encode($item['uri']) : '';
@@ -28,8 +28,8 @@ class AtomFormat extends FormatAbstract{
 			$entryContent = isset($item['content']) ? $this->xml_encode($this->sanitizeHtml($item['content'])) : '';
 
 			$entryEnclosures = '';
-			if(isset($item['enclosures'])){
-				foreach($item['enclosures'] as $enclosure){
+			if(isset($item['enclosures'])) {
+				foreach($item['enclosures'] as $enclosure) {
 					$entryEnclosures .= '<link rel="enclosure" href="'
 					. $this->xml_encode($enclosure)
 					. '"/>'
diff --git a/formats/HtmlFormat.php b/formats/HtmlFormat.php
index 2c26a0e4..fc4adcc0 100644
--- a/formats/HtmlFormat.php
+++ b/formats/HtmlFormat.php
@@ -9,13 +9,13 @@ class HtmlFormat extends FormatAbstract {
 		$mrssquery = str_replace('format=Html', 'format=Mrss', htmlentities($_SERVER['QUERY_STRING']));
 
 		$entries = '';
-		foreach($this->getItems() as $item){
+		foreach($this->getItems() as $item) {
 			$entryAuthor = isset($item['author']) ? '<br /><p class="author">by: ' . $item['author'] . '</p>' : '';
 			$entryTitle = isset($item['title']) ? $this->sanitizeHtml(strip_tags($item['title'])) : '';
 			$entryUri = isset($item['uri']) ? $item['uri'] : $uri;
 
 			$entryTimestamp = '';
-			if(isset($item['timestamp'])){
+			if(isset($item['timestamp'])) {
 				$entryTimestamp = '<time datetime="'
 				. date(DATE_ATOM, $item['timestamp'])
 				. '">'
@@ -24,17 +24,17 @@ class HtmlFormat extends FormatAbstract {
 			}
 
 			$entryContent = '';
-			if(isset($item['content'])){
+			if(isset($item['content'])) {
 				$entryContent = '<div class="content">'
 				. $this->sanitizeHtml($item['content'])
 				. '</div>';
 			}
 
 			$entryEnclosures = '';
-			if(isset($item['enclosures'])){
+			if(isset($item['enclosures'])) {
 				$entryEnclosures = '<div class="attachments"><p>Attachments:</p>';
 
-				foreach($item['enclosures'] as $enclosure){
+				foreach($item['enclosures'] as $enclosure) {
 					$url = $this->sanitizeHtml($enclosure);
 
 					$entryEnclosures .= '<li class="enclosure"><a href="'
diff --git a/formats/MrssFormat.php b/formats/MrssFormat.php
index a7573f56..2fcf2836 100644
--- a/formats/MrssFormat.php
+++ b/formats/MrssFormat.php
@@ -15,7 +15,7 @@ class MrssFormat extends FormatAbstract {
 		$extraInfos = $this->getExtraInfos();
 		$title = $this->xml_encode($extraInfos['name']);
 
-		if(!empty($extraInfos['uri'])){
+		if(!empty($extraInfos['uri'])) {
 			$uri = $this->xml_encode($extraInfos['uri']);
 		} else {
 			$uri = 'https://github.com/sebsauvage/rss-bridge';
@@ -24,7 +24,7 @@ class MrssFormat extends FormatAbstract {
 		$icon = $this->xml_encode('http://icons.better-idea.org/icon?url='. $uri .'&size=64');
 
 		$items = '';
-		foreach($this->getItems() as $item){
+		foreach($this->getItems() as $item) {
 			$itemAuthor = isset($item['author']) ? $this->xml_encode($item['author']) : '';
 			$itemTitle = strip_tags(isset($item['title']) ? $this->xml_encode($item['title']) : '');
 			$itemUri = isset($item['uri']) ? $this->xml_encode($item['uri']) : '';
@@ -33,16 +33,16 @@ class MrssFormat extends FormatAbstract {
 
 			$entryEnclosuresWarning = '';
 			$entryEnclosures = '';
-			if(isset($item['enclosures'])){
+			if(isset($item['enclosures'])) {
 				$entryEnclosures .= '<enclosure url="'
 				. $this->xml_encode($item['enclosures'][0])
 				. '"/>';
 
-				if(count($item['enclosures']) > 1){
+				if(count($item['enclosures']) > 1) {
 					$entryEnclosures .= PHP_EOL;
 					$entryEnclosuresWarning = '&lt;br&gt;Warning:
 Some media files might not be shown to you. Consider using the ATOM format instead!';
-					foreach($item['enclosures'] as $enclosure){
+					foreach($item['enclosures'] as $enclosure) {
 						$entryEnclosures .= '<atom:link rel="enclosure" href="'
 						. $enclosure . '" />'
 						. PHP_EOL;
diff --git a/index.php b/index.php
index 7fc2f8ad..fcfa3fac 100644
--- a/index.php
+++ b/index.php
@@ -32,19 +32,19 @@ define('CACHE_DIR', __DIR__ . '/cache');
   Debugging allows displaying PHP error messages and bypasses the cache: this can allow a malicious
   client to retrieve data about your server and hammer a provider throught your rss-bridge instance.
 */
-if(file_exists('DEBUG')){
+if(file_exists('DEBUG')) {
 	$debug_enabled = true;
 	$debug_whitelist = trim(file_get_contents('DEBUG'));
-	if(strlen($debug_whitelist) > 0){
+	if(strlen($debug_whitelist) > 0) {
 		$debug_enabled = false;
-		foreach(explode("\n", $debug_whitelist) as $allowed_ip){
-			if(trim($allowed_ip) === $_SERVER['REMOTE_ADDR']){
+		foreach(explode("\n", $debug_whitelist) as $allowed_ip) {
+			if(trim($allowed_ip) === $_SERVER['REMOTE_ADDR']) {
 				$debug_enabled = true;
 				break;
 			}
 		}
 	}
-	if($debug_enabled){
+	if($debug_enabled) {
 		ini_set('display_errors', '1');
 		error_reporting(E_ALL);
 		define('DEBUG', true);
@@ -102,7 +102,7 @@ try {
 	Format::setDir(__DIR__ . '/formats/');
 	Cache::setDir(__DIR__ . '/caches/');
 
-	if(!file_exists($whitelist_file)){
+	if(!file_exists($whitelist_file)) {
 		$whitelist_selection = $whitelist_default;
 		$whitelist_write = implode("\n", $whitelist_default);
 		file_put_contents($whitelist_file, $whitelist_write);
@@ -119,10 +119,10 @@ try {
 	$action = filter_input(INPUT_GET, 'action');
 	$bridge = filter_input(INPUT_GET, 'bridge');
 
-	if($action === 'display' && !empty($bridge)){
+	if($action === 'display' && !empty($bridge)) {
 		// DEPRECATED: 'nameBridge' scheme is replaced by 'name' in bridge parameter values
 		//             this is to keep compatibility until futher complete removal
-		if(($pos = strpos($bridge, 'Bridge')) === (strlen($bridge) - strlen('Bridge'))){
+		if(($pos = strpos($bridge, 'Bridge')) === (strlen($bridge) - strlen('Bridge'))) {
 			$bridge = substr($bridge, 0, $pos);
 		}
 
@@ -130,12 +130,12 @@ try {
 
 		// DEPRECATED: 'nameFormat' scheme is replaced by 'name' in format parameter values
 		//             this is to keep compatibility until futher complete removal
-		if(($pos = strpos($format, 'Format')) === (strlen($format) - strlen('Format'))){
+		if(($pos = strpos($format, 'Format')) === (strlen($format) - strlen('Format'))) {
 			$format = substr($format, 0, $pos);
 		}
 
 		// whitelist control
-		if(!Bridge::isWhitelisted($whitelist_selection, $bridge)){
+		if(!Bridge::isWhitelisted($whitelist_selection, $bridge)) {
 			throw new \HttpException('This bridge is not whitelisted', 401);
 			die;
 		}
@@ -144,7 +144,7 @@ try {
 		$bridge = Bridge::create($bridge);
 
 		$noproxy = filter_input(INPUT_GET, '_noproxy', FILTER_VALIDATE_BOOLEAN);
-		if(defined('PROXY_URL') && PROXY_BYBRIDGE && $noproxy){
+		if(defined('PROXY_URL') && PROXY_BYBRIDGE && $noproxy) {
 			define('NOPROXY', true);
 		}
 
@@ -165,7 +165,7 @@ try {
 		try {
 			$bridge->setCache($cache);
 			$bridge->setDatas($params);
-		} catch(Exception $e){
+		} catch(Exception $e) {
 			header('HTTP/1.1 ' . $e->getCode() . ' ' . Http::getMessageForCode($e->getCode()));
 			header('Content-Type: text/html');
 			die(buildBridgeException($e, $bridge));
@@ -177,7 +177,7 @@ try {
 			$format->setItems($bridge->getItems());
 			$format->setExtraInfos($bridge->getExtraInfos());
 			$format->display();
-		} catch(Exception $e){
+		} catch(Exception $e) {
 			header('HTTP/1.1 ' . $e->getCode() . ' ' . Http::getMessageForCode($e->getCode()));
 			header('Content-Type: text/html');
 			die(buildTransformException($e, $bridge));
@@ -185,15 +185,11 @@ try {
 
 		die;
 	}
-}
-
-catch(HttpException $e){
+} catch(HttpException $e) {
 	header('HTTP/1.1 ' . $e->getCode() . ' ' . Http::getMessageForCode($e->getCode()));
 	header('Content-Type: text/plain');
 	die($e->getMessage());
-}
-
-catch(\Exception $e){
+} catch(\Exception $e) {
 	die($e->getMessage());
 }
 
@@ -221,7 +217,7 @@ $formats = Format::searchInformation();
 <body onload="search()">
 	<?php
 		$status = '';
-		if(defined('DEBUG') && DEBUG === true){
+		if(defined('DEBUG') && DEBUG === true) {
 			$status .= 'debug mode active';
 		}
 
@@ -244,8 +240,8 @@ EOD;
 		$showInactive = filter_input(INPUT_GET, 'show_inactive', FILTER_VALIDATE_BOOLEAN);
 		$inactiveBridges = '';
 		$bridgeList = Bridge::listBridges();
-		foreach($bridgeList as $bridgeName){
-			if(Bridge::isWhitelisted($whitelist_selection, $bridgeName)){
+		foreach($bridgeList as $bridgeName) {
+			if(Bridge::isWhitelisted($whitelist_selection, $bridgeName)) {
 				echo displayBridgeCard($bridgeName, $formats);
 						$activeFoundBridgeCount++;
 			} elseif($showInactive) {
@@ -259,7 +255,7 @@ EOD;
 		<a href="https://github.com/RSS-Bridge/rss-bridge">RSS-Bridge alpha 0.2 ~ Public Domain</a><br />
 		<?= $activeFoundBridgeCount; ?>/<?= count($bridgeList) ?> active bridges. <br />
 		<?php
-			if($activeFoundBridgeCount !== count($bridgeList)){
+			if($activeFoundBridgeCount !== count($bridgeList)) {
 				// FIXME: This should be done in pure CSS
 				if(!$showInactive)
 					echo '<a href="?show_inactive=1"><button class="small">Show inactive bridges</button></a><br />';
diff --git a/lib/Bridge.php b/lib/Bridge.php
index cdddc30f..d0a127ef 100644
--- a/lib/Bridge.php
+++ b/lib/Bridge.php
@@ -24,7 +24,7 @@ class Bridge {
 	* @return Bridge object dedicated
 	*/
 	static public function create($nameBridge){
-		if(!preg_match('@^[A-Z][a-zA-Z0-9-]*$@', $nameBridge)){
+		if(!preg_match('@^[A-Z][a-zA-Z0-9-]*$@', $nameBridge)) {
 			$message = <<<EOD
 'nameBridge' must start with one uppercase character followed or not by
 alphanumeric or dash characters!
@@ -35,14 +35,14 @@ EOD;
 		$nameBridge = $nameBridge . 'Bridge';
 		$pathBridge = self::getDir() . $nameBridge . '.php';
 
-		if(!file_exists($pathBridge)){
+		if(!file_exists($pathBridge)) {
 			throw new \Exception('The bridge you looking for does not exist. It should be at path '
 			. $pathBridge);
 		}
 
 		require_once $pathBridge;
 
-		if(Bridge::isInstantiable($nameBridge)){
+		if(Bridge::isInstantiable($nameBridge)) {
 			return new $nameBridge();
 		} else {
 			return false;
@@ -50,11 +50,11 @@ EOD;
 	}
 
 	static public function setDir($dirBridge){
-		if(!is_string($dirBridge)){
+		if(!is_string($dirBridge)) {
 			throw new \InvalidArgumentException('Dir bridge must be a string.');
 		}
 
-		if(!file_exists($dirBridge)){
+		if(!file_exists($dirBridge)) {
 			throw new \Exception('Dir bridge does not exist.');
 		}
 
@@ -64,7 +64,7 @@ EOD;
 	static public function getDir(){
 		$dirBridge = self::$dirBridge;
 
-		if(is_null($dirBridge)){
+		if(is_null($dirBridge)) {
 			throw new \LogicException(__CLASS__ . ' class need to know bridge path !');
 		}
 
@@ -80,9 +80,9 @@ EOD;
 		$listBridge = array();
 		$dirFiles = scandir($pathDirBridge);
 
-		if($dirFiles !== false){
-			foreach($dirFiles as $fileName){
-				if(preg_match('@^([^.]+)Bridge\.php$@U', $fileName, $out)){
+		if($dirFiles !== false) {
+			foreach($dirFiles as $fileName) {
+				if(preg_match('@^([^.]+)Bridge\.php$@U', $fileName, $out)) {
 					$listBridge[] = $out[1];
 				}
 			}
@@ -96,7 +96,7 @@ EOD;
 		|| in_array($name . '.php', $whitelist)
 		|| in_array($name . 'Bridge', $whitelist) // DEPRECATED
 		|| in_array($name . 'Bridge.php', $whitelist) // DEPRECATED
-		|| (count($whitelist) === 1 && trim($whitelist[0]) === '*')){
+		|| (count($whitelist) === 1 && trim($whitelist[0]) === '*')) {
 			return true;
 		} else {
 			return false;
diff --git a/lib/BridgeAbstract.php b/lib/BridgeAbstract.php
index 898b4d05..cd2ff632 100644
--- a/lib/BridgeAbstract.php
+++ b/lib/BridgeAbstract.php
@@ -43,9 +43,9 @@ abstract class BridgeAbstract implements BridgeInterface {
 	 */
 	protected function setInputs(array $inputs, $queriedContext){
 		// Import and assign all inputs to their context
-		foreach($inputs as $name => $value){
-			foreach(static::PARAMETERS as $context => $set){
-				if(array_key_exists($name, static::PARAMETERS[$context])){
+		foreach($inputs as $name => $value) {
+			foreach(static::PARAMETERS as $context => $set) {
+				if(array_key_exists($name, static::PARAMETERS[$context])) {
 					$this->inputs[$context][$name]['value'] = $value;
 				}
 			}
@@ -53,30 +53,30 @@ abstract class BridgeAbstract implements BridgeInterface {
 
 		// Apply default values to missing data
 		$contexts = array($queriedContext);
-		if(array_key_exists('global', static::PARAMETERS)){
+		if(array_key_exists('global', static::PARAMETERS)) {
 			$contexts[] = 'global';
 		}
 
-		foreach($contexts as $context){
-			foreach(static::PARAMETERS[$context] as $name => $properties){
-				if(isset($this->inputs[$context][$name]['value'])){
+		foreach($contexts as $context) {
+			foreach(static::PARAMETERS[$context] as $name => $properties) {
+				if(isset($this->inputs[$context][$name]['value'])) {
 					continue;
 				}
 
 				$type = isset($properties['type']) ? $properties['type'] : 'text';
 
-				switch($type){
+				switch($type) {
 				case 'checkbox':
-					if(!isset($properties['defaultValue'])){
+					if(!isset($properties['defaultValue'])) {
 						$this->inputs[$context][$name]['value'] = false;
 					} else {
 						$this->inputs[$context][$name]['value'] = $properties['defaultValue'];
 					}
 					break;
 				case 'list':
-					if(!isset($properties['defaultValue'])){
+					if(!isset($properties['defaultValue'])) {
 						$firstItem = reset($properties['values']);
-						if(is_array($firstItem)){
+						if(is_array($firstItem)) {
 							$firstItem = reset($firstItem);
 						}
 						$this->inputs[$context][$name]['value'] = $firstItem;
@@ -85,7 +85,7 @@ abstract class BridgeAbstract implements BridgeInterface {
 					}
 					break;
 				default:
-					if(isset($properties['defaultValue'])){
+					if(isset($properties['defaultValue'])) {
 						$this->inputs[$context][$name]['value'] = $properties['defaultValue'];
 					}
 					break;
@@ -94,11 +94,11 @@ abstract class BridgeAbstract implements BridgeInterface {
 		}
 
 		// Copy global parameter values to the guessed context
-		if(array_key_exists('global', static::PARAMETERS)){
-			foreach(static::PARAMETERS['global'] as $name => $properties){
-				if(isset($inputs[$name])){
+		if(array_key_exists('global', static::PARAMETERS)) {
+			foreach(static::PARAMETERS['global'] as $name => $properties) {
+				if(isset($inputs[$name])) {
 					$value = $inputs[$name];
-				} elseif(isset($properties['value'])){
+				} elseif(isset($properties['value'])) {
 					$value = $properties['value'];
 				} else {
 					continue;
@@ -108,7 +108,7 @@ abstract class BridgeAbstract implements BridgeInterface {
 		}
 
 		// Only keep guessed context parameters values
-		if(isset($this->inputs[$queriedContext])){
+		if(isset($this->inputs[$queriedContext])) {
 			$this->inputs = array($queriedContext => $this->inputs[$queriedContext]);
 		} else {
 			$this->inputs = array();
@@ -125,15 +125,15 @@ abstract class BridgeAbstract implements BridgeInterface {
 		$queriedContexts = array();
 
 		// Detect matching context
-		foreach(static::PARAMETERS as $context => $set){
+		foreach(static::PARAMETERS as $context => $set) {
 			$queriedContexts[$context] = null;
 
 			// Check if all parameters of the context are satisfied
-			foreach($set as $id => $properties){
-				if(isset($inputs[$id]) && !empty($inputs[$id])){
+			foreach($set as $id => $properties) {
+				if(isset($inputs[$id]) && !empty($inputs[$id])) {
 					$queriedContexts[$context] = true;
 				} elseif(isset($properties['required'])
-				&& $properties['required'] === true){
+				&& $properties['required'] === true) {
 					$queriedContexts[$context] = false;
 					break;
 				}
@@ -143,15 +143,15 @@ abstract class BridgeAbstract implements BridgeInterface {
 
 		// Abort if one of the globally required parameters is not satisfied
 		if(array_key_exists('global', static::PARAMETERS)
-		&& $queriedContexts['global'] === false){
+		&& $queriedContexts['global'] === false) {
 			return null;
 		}
 		unset($queriedContexts['global']);
 
-		switch(array_sum($queriedContexts)){
+		switch(array_sum($queriedContexts)) {
 		case 0: // Found no match, is there a context without parameters?
-			foreach($queriedContexts as $context => $queried){
-				if(is_null($queried)){
+			foreach($queriedContexts as $context => $queried) {
+				if(is_null($queried)) {
 					return $context;
 				}
 			}
@@ -168,13 +168,13 @@ abstract class BridgeAbstract implements BridgeInterface {
 	* @param array array with expected bridge paramters
 	*/
 	public function setDatas(array $inputs){
-		if(!is_null($this->cache)){
+		if(!is_null($this->cache)) {
 			$time = $this->cache->getTime();
 			if($time !== false
 			&& (time() - static::CACHE_TIMEOUT < $time)
-			&& (!defined('DEBUG') || DEBUG !== true)){
+			&& (!defined('DEBUG') || DEBUG !== true)) {
 				$cached = $this->cache->loadData();
-				if(isset($cached['items']) && isset($cached['extraInfos'])){
+				if(isset($cached['items']) && isset($cached['extraInfos'])) {
 					$this->items = $cached['items'];
 					$this->extraInfos = $cached['extraInfos'];
 					return;
@@ -182,27 +182,27 @@ abstract class BridgeAbstract implements BridgeInterface {
 			}
 		}
 
-		if(empty(static::PARAMETERS)){
-			if(!empty($inputs)){
+		if(empty(static::PARAMETERS)) {
+			if(!empty($inputs)) {
 				returnClientError('Invalid parameters value(s)');
 			}
 
 			$this->collectData();
-			if(!is_null($this->cache)){
+			if(!is_null($this->cache)) {
 				$this->cache->saveData($this->getCachable());
 			}
 			return;
 		}
 
-		if(!validateData($inputs, static::PARAMETERS)){
+		if(!validateData($inputs, static::PARAMETERS)) {
 			returnClientError('Invalid parameters value(s)');
 		}
 
 		// Guess the paramter context from input data
 		$this->queriedContext = $this->getQueriedContext($inputs);
-		if(is_null($this->queriedContext)){
+		if(is_null($this->queriedContext)) {
 			returnClientError('Required parameter(s) missing');
-		} elseif($this->queriedContext === false){
+		} elseif($this->queriedContext === false) {
 			returnClientError('Mixed context parameters');
 		}
 
@@ -210,7 +210,7 @@ abstract class BridgeAbstract implements BridgeInterface {
 
 		$this->collectData();
 
-		if(!is_null($this->cache)){
+		if(!is_null($this->cache)) {
 			$this->cache->saveData($this->getCachable());
 		}
 	}
@@ -222,7 +222,7 @@ abstract class BridgeAbstract implements BridgeInterface {
 	 * @return mixed Returns the input value or null if the input is not defined
 	 */
 	protected function getInput($input){
-		if(!isset($this->inputs[$this->queriedContext][$input]['value'])){
+		if(!isset($this->inputs[$this->queriedContext][$input]['value'])) {
 			return null;
 		}
 		return $this->inputs[$this->queriedContext][$input]['value'];
@@ -238,7 +238,7 @@ abstract class BridgeAbstract implements BridgeInterface {
 
 	public function getName(){
 		// Return cached name when bridge is using cached data
-		if(isset($this->extraInfos)){
+		if(isset($this->extraInfos)) {
 			return $this->extraInfos['name'];
 		}
 
@@ -251,7 +251,7 @@ abstract class BridgeAbstract implements BridgeInterface {
 
 	public function getURI(){
 		// Return cached uri when bridge is using cached data
-		if(isset($this->extraInfos)){
+		if(isset($this->extraInfos)) {
 			return $this->extraInfos['uri'];
 		}
 
diff --git a/lib/Cache.php b/lib/Cache.php
index 414e6824..bc177585 100644
--- a/lib/Cache.php
+++ b/lib/Cache.php
@@ -9,14 +9,14 @@ class Cache {
 	}
 
 	static public function create($nameCache){
-		if(!static::isValidNameCache($nameCache)){
+		if(!static::isValidNameCache($nameCache)) {
 			throw new \InvalidArgumentException('Name cache must be at least one
  uppercase follow or not by alphanumeric or dash characters.');
 		}
 
 		$pathCache = self::getDir() . $nameCache . '.php';
 
-		if(!file_exists($pathCache)){
+		if(!file_exists($pathCache)) {
 			throw new \Exception('The cache you looking for does not exist.');
 		}
 
@@ -26,11 +26,11 @@ class Cache {
 	}
 
 	static public function setDir($dirCache){
-		if(!is_string($dirCache)){
+		if(!is_string($dirCache)) {
 			throw new \InvalidArgumentException('Dir cache must be a string.');
 		}
 
-		if(!file_exists($dirCache)){
+		if(!file_exists($dirCache)) {
 			throw new \Exception('Dir cache does not exist.');
 		}
 
@@ -40,7 +40,7 @@ class Cache {
 	static public function getDir(){
 		$dirCache = self::$dirCache;
 
-		if(is_null($dirCache)){
+		if(is_null($dirCache)) {
 			throw new \LogicException(__CLASS__ . ' class need to know cache path !');
 		}
 
diff --git a/lib/FeedExpander.php b/lib/FeedExpander.php
index b45a46f0..ff209495 100644
--- a/lib/FeedExpander.php
+++ b/lib/FeedExpander.php
@@ -7,7 +7,7 @@ abstract class FeedExpander extends BridgeAbstract {
 	private $feedType;
 
 	public function collectExpandableDatas($url, $maxItems = -1){
-		if(empty($url)){
+		if(empty($url)) {
 			returnServerError('There is no $url for this RSS expander');
 		}
 
@@ -21,7 +21,7 @@ abstract class FeedExpander extends BridgeAbstract {
 		$rssContent = simplexml_load_string($content);
 
 		debugMessage('Detecting feed format/version');
-		switch(true){
+		switch(true) {
 		case isset($rssContent->item[0]):
 			debugMessage('Detected RSS 1.0 format');
 			$this->feedType = "RSS_1_0";
@@ -46,7 +46,7 @@ abstract class FeedExpander extends BridgeAbstract {
 
 	protected function collect_RSS_1_0_data($rssContent, $maxItems){
 		$this->load_RSS_2_0_feed_data($rssContent->channel[0]);
-		foreach($rssContent->item as $item){
+		foreach($rssContent->item as $item) {
 			debugMessage('parsing item ' . var_export($item, true));
 			$tmp_item = $this->parseItem($item);
 			if (!empty($tmp_item)) {
@@ -63,7 +63,7 @@ abstract class FeedExpander extends BridgeAbstract {
 		. '===========');
 
 		$this->load_RSS_2_0_feed_data($rssContent);
-		foreach($rssContent->item as $item){
+		foreach($rssContent->item as $item) {
 			debugMessage('parsing item ' . var_export($item, true));
 			$tmp_item = $this->parseItem($item);
 			if (!empty($tmp_item)) {
@@ -75,7 +75,7 @@ abstract class FeedExpander extends BridgeAbstract {
 
 	protected function collect_ATOM_1_0_data($content, $maxItems){
 		$this->load_ATOM_feed_data($content);
-		foreach($content->entry as $item){
+		foreach($content->entry as $item) {
 			debugMessage('parsing item ' . var_export($item, true));
 			$tmp_item = $this->parseItem($item);
 			if (!empty($tmp_item)) {
@@ -99,14 +99,14 @@ abstract class FeedExpander extends BridgeAbstract {
 		$this->name = (string)$content->title;
 
 		// Find best link (only one, or first of 'alternate')
-		if(!isset($content->link)){
+		if(!isset($content->link)) {
 			$this->uri = '';
-		} elseif (count($content->link) === 1){
+		} elseif (count($content->link) === 1) {
 			$this->uri = $content->link[0]['href'];
 		} else {
 			$this->uri = '';
-			foreach($content->link as $link){
-				if(strtolower($link['rel']) === 'alternate'){
+			foreach($content->link as $link) {
+				if(strtolower($link['rel']) === 'alternate') {
 					$this->uri = $link['href'];
 					break;
 				}
@@ -139,7 +139,7 @@ abstract class FeedExpander extends BridgeAbstract {
 		$item = $this->parseRSS_0_9_1_Item($feedItem);
 
 		$namespaces = $feedItem->getNamespaces(true);
-		if(isset($namespaces['dc'])){
+		if(isset($namespaces['dc'])) {
 			$dc = $feedItem->children($namespaces['dc']);
 			if(isset($dc->date)) $item['timestamp'] = strtotime((string)$dc->date);
 			if(isset($dc->creator)) $item['author'] = (string)$dc->creator;
@@ -155,24 +155,24 @@ abstract class FeedExpander extends BridgeAbstract {
 		$namespaces = $feedItem->getNamespaces(true);
 		if(isset($namespaces['dc'])) $dc = $feedItem->children($namespaces['dc']);
 
-		if(isset($feedItem->guid)){
-			foreach($feedItem->guid->attributes() as $attribute => $value){
+		if(isset($feedItem->guid)) {
+			foreach($feedItem->guid->attributes() as $attribute => $value) {
 				if($attribute === 'isPermaLink'
-				&& ($value === 'true' || filter_var($feedItem->guid, FILTER_VALIDATE_URL))){
+				&& ($value === 'true' || filter_var($feedItem->guid, FILTER_VALIDATE_URL))) {
 					$item['uri'] = (string)$feedItem->guid;
 					break;
 				}
 			}
 		}
 
-		if(isset($feedItem->pubDate)){
+		if(isset($feedItem->pubDate)) {
 			$item['timestamp'] = strtotime((string)$feedItem->pubDate);
-		} elseif(isset($dc->date)){
+		} elseif(isset($dc->date)) {
 			$item['timestamp'] = strtotime((string)$dc->date);
 		}
-		if(isset($feedItem->author)){
+		if(isset($feedItem->author)) {
 			$item['author'] = (string)$feedItem->author;
-		} elseif(isset($dc->creator)){
+		} elseif(isset($dc->creator)) {
 			$item['author'] = (string)$dc->creator;
 		}
 		return $item;
@@ -184,7 +184,7 @@ abstract class FeedExpander extends BridgeAbstract {
 	 * @return a RSS-Bridge Item, with (hopefully) the whole content)
 	 */
 	protected function parseItem($item){
-		switch($this->feedType){
+		switch($this->feedType) {
 		case 'RSS_1_0':
 			return $this->parseRSS_1_0_Item($item);
 			break;
diff --git a/lib/Format.php b/lib/Format.php
index 26c95a93..ab932cc7 100644
--- a/lib/Format.php
+++ b/lib/Format.php
@@ -9,7 +9,7 @@ class Format {
 	}
 
 	static public function create($nameFormat){
-		if(!preg_match('@^[A-Z][a-zA-Z]*$@', $nameFormat)){
+		if(!preg_match('@^[A-Z][a-zA-Z]*$@', $nameFormat)) {
 			throw new \InvalidArgumentException('Name format must be at least
  one uppercase follow or not by alphabetic characters.');
 		}
@@ -17,7 +17,7 @@ class Format {
 		$nameFormat = $nameFormat . 'Format';
 		$pathFormat = self::getDir() . $nameFormat . '.php';
 
-		if(!file_exists($pathFormat)){
+		if(!file_exists($pathFormat)) {
 			throw new \Exception('The format you looking for does not exist.');
 		}
 
@@ -27,11 +27,11 @@ class Format {
 	}
 
 	static public function setDir($dirFormat){
-		if(!is_string($dirFormat)){
+		if(!is_string($dirFormat)) {
 			throw new \InvalidArgumentException('Dir format must be a string.');
 		}
 
-		if(!file_exists($dirFormat)){
+		if(!file_exists($dirFormat)) {
 			throw new \Exception('Dir format does not exist.');
 		}
 
@@ -41,7 +41,7 @@ class Format {
 	static public function getDir(){
 		$dirFormat = self::$dirFormat;
 
-		if(is_null($dirFormat)){
+		if(is_null($dirFormat)) {
 			throw new \LogicException(__CLASS__ . ' class need to know format path !');
 		}
 
@@ -60,9 +60,9 @@ class Format {
 		$searchCommonPattern = array('name');
 
 		$dirFiles = scandir($pathDirFormat);
-		if($dirFiles !== false){
-			foreach($dirFiles as $fileName){
-				if(preg_match('@^([^.]+)Format\.php$@U', $fileName, $out)){ // Is PHP file ?
+		if($dirFiles !== false) {
+			foreach($dirFiles as $fileName) {
+				if(preg_match('@^([^.]+)Format\.php$@U', $fileName, $out)) { // Is PHP file ?
 					$listFormat[] = $out[1];
 				}
 			}
diff --git a/lib/FormatAbstract.php b/lib/FormatAbstract.php
index 08be1236..46d5e4ab 100644
--- a/lib/FormatAbstract.php
+++ b/lib/FormatAbstract.php
@@ -56,8 +56,8 @@ abstract class FormatAbstract implements FormatInterface {
 	* @return this
 	*/
 	public function setExtraInfos(array $extraInfos = array()){
-		foreach(array('name', 'uri') as $infoName){
-			if( !isset($extraInfos[$infoName]) ){
+		foreach(array('name', 'uri') as $infoName) {
+			if(!isset($extraInfos[$infoName])) {
 				$extraInfos[$infoName] = '';
 			}
 		}
@@ -72,7 +72,7 @@ abstract class FormatAbstract implements FormatInterface {
 	* @return array See "setExtraInfos" detail method to know what extra are disponibles
 	*/
 	public function getExtraInfos(){
-		if( is_null($this->extraInfos) ){ // No extra info ?
+		if(is_null($this->extraInfos)) { // No extra info ?
 			$this->setExtraInfos(); // Define with default value
 		}
 
@@ -97,7 +97,7 @@ abstract class FormatAbstract implements FormatInterface {
 	}
 
 	protected function array_trim($elements){
-		foreach($elements as $key => $value){
+		foreach($elements as $key => $value) {
 			if(is_string($value))
 				$elements[$key] = trim($value);
 		}
diff --git a/lib/RssBridge.php b/lib/RssBridge.php
index b465450b..e2f9be3a 100644
--- a/lib/RssBridge.php
+++ b/lib/RssBridge.php
@@ -21,7 +21,7 @@ require __DIR__ . '/error.php';
 require __DIR__ . '/contents.php';
 
 $vendorLibSimpleHtmlDom = __DIR__ . PATH_VENDOR . '/simplehtmldom/simple_html_dom.php';
-if(!file_exists($vendorLibSimpleHtmlDom)){
+if(!file_exists($vendorLibSimpleHtmlDom)) {
 	throw new \HttpException('"PHP Simple HTML DOM Parser" library is missing.
  Get it from http://simplehtmldom.sourceforge.net and place the script "simple_html_dom.php" in '
 		. substr(PATH_VENDOR, 4)
diff --git a/lib/contents.php b/lib/contents.php
index 0d823ef2..ec62c8db 100644
--- a/lib/contents.php
+++ b/lib/contents.php
@@ -11,21 +11,21 @@ $maxlen = null){
 		)
 	);
 
-	if(defined('PROXY_URL') && !defined('NOPROXY')){
+	if(defined('PROXY_URL') && !defined('NOPROXY')) {
 		$contextOptions['http']['proxy'] = PROXY_URL;
 		$contextOptions['http']['request_fulluri'] = true;
 
-		if(is_null($context)){
+		if(is_null($context)) {
 			$context = stream_context_create($contextOptions);
 		} else {
 			$prevContext = $context;
-			if(!stream_context_set_option($context, $contextOptions)){
+			if(!stream_context_set_option($context, $contextOptions)) {
 				$context = $prevContext;
 			}
 		}
 	}
 
-	if(is_null($maxlen)){
+	if(is_null($maxlen)) {
 		$content = file_get_contents($url, $use_include_path, $context, $offset);
 	} else {
 		$content = file_get_contents($url, $use_include_path, $context, $offset, $maxlen);
@@ -35,9 +35,9 @@ $maxlen = null){
 		debugMessage('Cant\'t download ' . $url);
 
 	// handle compressed data
-	foreach($http_response_header as $header){
-		if(stristr($header, 'content-encoding')){
-			switch(true){
+	foreach($http_response_header as $header) {
+		if(stristr($header, 'content-encoding')) {
+			switch(true) {
 			case stristr($header, 'gzip'):
 				$content = gzinflate(substr($content, 10, -8));
 				break;
@@ -113,11 +113,11 @@ $defaultSpanText = DEFAULT_SPAN_TEXT){
 	$time = $cache->getTime();
 	if($time !== false
 	&& (time() - $duration < $time)
-	&& (!defined('DEBUG') || DEBUG !== true)){ // Contents within duration
+	&& (!defined('DEBUG') || DEBUG !== true)) { // Contents within duration
 		$content = $cache->loadData();
 	} else { // Content not within duration
 		$content = getContents($url, $use_include_path, $context, $offset, $maxLen);
-		if($content !== false){
+		if($content !== false) {
 			$cache->saveData($content);
 		}
 	}
diff --git a/lib/html.php b/lib/html.php
index 8643fa1f..4c6c3203 100644
--- a/lib/html.php
+++ b/lib/html.php
@@ -3,7 +3,7 @@ function displayBridgeCard($bridgeName, $formats, $isActive = true){
 
 	$getHelperButtonsFormat = function($formats){
 		$buttons = '';
-		foreach($formats as $name){
+		foreach($formats as $name) {
 			$buttons .= '<button type="submit" name="format" value="'
 				. $name
 				. '">'
@@ -50,13 +50,13 @@ EOD;
 CARD;
 
 	// If we don't have any parameter for the bridge, we print a generic form to load it.
-	if(count($bridge->getParameters()) == 0){
+	if(count($bridge->getParameters()) == 0) {
 
 		$card .= $getFormHeader($bridgeName);
 		$card .= $HTTPSWarning;
 
-		if($isActive){
-			if(defined('PROXY_URL') && PROXY_BYBRIDGE){
+		if($isActive) {
+			if(defined('PROXY_URL') && PROXY_BYBRIDGE) {
 				$idArg = 'arg-'
 					. urlencode($bridgeName)
 					. '-'
@@ -87,11 +87,11 @@ CARD;
 
 	$hasGlobalParameter = array_key_exists('global', $bridge->getParameters());
 
-	if($hasGlobalParameter){
+	if($hasGlobalParameter) {
 		$globalParameters = $bridge->getParameters()['global'];
 	}
 
-	foreach($bridge->getParameters() as $parameterName => $parameter){
+	foreach($bridge->getParameters() as $parameterName => $parameter) {
 		if(!is_numeric($parameterName) && $parameterName == 'global')
 			continue;
 
@@ -104,7 +104,7 @@ CARD;
 		$card .= $getFormHeader($bridgeName);
 		$card .= $HTTPSWarning;
 
-		foreach($parameter as $id => $inputEntry){
+		foreach($parameter as $id => $inputEntry) {
 			$additionalInfoString = '';
 
 			if(isset($inputEntry['required']) && $inputEntry['required'] === true)
@@ -136,7 +136,7 @@ CARD;
 				. ' : </label>'
 				. PHP_EOL;
 
-			if(!isset($inputEntry['type']) || $inputEntry['type'] == 'text'){
+			if(!isset($inputEntry['type']) || $inputEntry['type'] == 'text') {
 				$card .= '<input '
 					. $additionalInfoString
 					. ' id="'
@@ -149,7 +149,7 @@ CARD;
 					. $id
 					. '" /><br />'
 					. PHP_EOL;
-			} elseif($inputEntry['type'] == 'number'){
+			} elseif($inputEntry['type'] == 'number') {
 				$card .= '<input '
 					. $additionalInfoString
 					. ' id="'
@@ -162,7 +162,7 @@ CARD;
 					. $id
 					. '" /><br />'
 					. PHP_EOL;
-			} else if($inputEntry['type'] == 'list'){
+			} else if($inputEntry['type'] == 'list') {
 				$card .= '<select '
 					. $additionalInfoString
 					. ' id="'
@@ -171,12 +171,12 @@ CARD;
 					. $id
 					. '" >';
 
-				foreach($inputEntry['values'] as $name => $value){
-					if(is_array($value)){
+				foreach($inputEntry['values'] as $name => $value) {
+					if(is_array($value)) {
 						$card .= '<optgroup label="' . htmlentities($name) . '">';
-						foreach($value as $subname => $subvalue){
+						foreach($value as $subname => $subvalue) {
 							if($inputEntry['defaultValue'] === $subname
-								|| $inputEntry['defaultValue'] === $subvalue){
+								|| $inputEntry['defaultValue'] === $subvalue) {
 								$card .= '<option value="'
 									. $subvalue
 									. '" selected>'
@@ -193,7 +193,7 @@ CARD;
 						$card .= '</optgroup>';
 					} else {
 						if($inputEntry['defaultValue'] === $name
-							|| $inputEntry['defaultValue'] === $value){
+							|| $inputEntry['defaultValue'] === $value) {
 							$card .= '<option value="'
 								. $value
 								. '" selected>'
@@ -209,7 +209,7 @@ CARD;
 					}
 				}
 				$card .= '</select><br >';
-			} elseif($inputEntry['type'] == 'checkbox'){
+			} elseif($inputEntry['type'] == 'checkbox') {
 				if($inputEntry['defaultValue'] === 'checked')
 					$card .= '<input '
 					. $additionalInfoString
@@ -231,8 +231,8 @@ CARD;
 			}
 		}
 
-		if($isActive){
-			if(defined('PROXY_URL') && PROXY_BYBRIDGE){
+		if($isActive) {
+			if(defined('PROXY_URL') && PROXY_BYBRIDGE) {
 				$idArg = 'arg-'
 					. urlencode($bridgeName)
 					. '-'
@@ -272,13 +272,13 @@ $keptAttributes = array('title', 'href', 'src'),
 $keptText = array()){
 	$htmlContent = str_get_html($textToSanitize);
 
-	foreach($htmlContent->find('*[!b38fd2b1fe7f4747d6b1c1254ccd055e]') as $element){
-		if(in_array($element->tag, $keptText)){
+	foreach($htmlContent->find('*[!b38fd2b1fe7f4747d6b1c1254ccd055e]') as $element) {
+		if(in_array($element->tag, $keptText)) {
 			$element->outertext = $element->plaintext;
-		} elseif(in_array($element->tag, $removedTags)){
+		} elseif(in_array($element->tag, $removedTags)) {
 			$element->outertext = '';
 		} else {
-			foreach($element->getAllAttributes() as $attributeName => $attribute){
+			foreach($element->getAllAttributes() as $attributeName => $attribute) {
 				if(!in_array($attributeName, $keptAttributes))
 					$element->removeAttribute($attributeName);
 			}
@@ -308,14 +308,14 @@ function backgroundToImg($htmlContent) {
 }
 
 function defaultLinkTo($content, $server){
-	foreach($content->find('img') as $image){
+	foreach($content->find('img') as $image) {
 		if(strpos($image->src, 'http') === false
 		&& strpos($image->src, '//') === false
 		&& strpos($image->src, 'data:') === false)
 			$image->src = $server . $image->src;
 	}
 
-	foreach($content->find('a') as $anchor){
+	foreach($content->find('a') as $anchor) {
 		if(strpos($anchor->href, 'http') === false
 		&& strpos($anchor->href, '//') === false
 		&& strpos($anchor->href, '#') !== 0
diff --git a/lib/validation.php b/lib/validation.php
index 037bc693..7bcbbf5e 100644
--- a/lib/validation.php
+++ b/lib/validation.php
@@ -1,7 +1,7 @@
 <?php
 function validateData(&$data, $parameters){
 	$validateTextValue = function($value, $pattern = null){
-		if(!is_null($pattern)){
+		if(!is_null($pattern)) {
 			$filteredValue = filter_var($value,
 			FILTER_VALIDATE_REGEXP,
 			array('options' => array(
@@ -42,8 +42,8 @@ function validateData(&$data, $parameters){
 		if($filteredValue === false)
 			return null;
 
-		if(!in_array($filteredValue, $expectedValues)){ // Check sub-values?
-			foreach($expectedValues as $subName => $subValue){
+		if(!in_array($filteredValue, $expectedValues)) { // Check sub-values?
+			foreach($expectedValues as $subName => $subValue) {
 				if(is_array($subValue) && in_array($filteredValue, $subValue))
 					return $filteredValue;
 			}
@@ -56,16 +56,16 @@ function validateData(&$data, $parameters){
 	if(!is_array($data))
 		return false;
 
-	foreach($data as $name => $value){
+	foreach($data as $name => $value) {
 		$registered = false;
-		foreach($parameters as $context => $set){
-			if(array_key_exists($name, $set)){
+		foreach($parameters as $context => $set) {
+			if(array_key_exists($name, $set)) {
 				$registered = true;
-				if(!isset($set[$name]['type'])){
+				if(!isset($set[$name]['type'])) {
 					$set[$name]['type'] = 'text';
 				}
 
-				switch($set[$name]['type']){
+				switch($set[$name]['type']) {
 				case 'number':
 					$data[$name] = $validateNumberValue($value);
 					break;
@@ -77,7 +77,7 @@ function validateData(&$data, $parameters){
 					break;
 				default:
 				case 'text':
-					if(isset($set[$name]['pattern'])){
+					if(isset($set[$name]['pattern'])) {
 						$data[$name] = $validateTextValue($value, $set[$name]['pattern']);
 					} else {
 						$data[$name] = $validateTextValue($value);
@@ -85,7 +85,7 @@ function validateData(&$data, $parameters){
 					break;
 				}
 
-				if(is_null($data[$name])){
+				if(is_null($data[$name])) {
 					echo 'Parameter \'' . $name . '\' is invalid!' . PHP_EOL;
 					return false;
 				}
diff --git a/phpcs.xml b/phpcs.xml
index ded81e77..c88b0f50 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -42,8 +42,17 @@
   <rule ref="PEAR.NamingConventions.ValidClassName"/>
   <!-- Use 'elseif' instead of 'else if' -->
   <rule ref="PSR2.ControlStructures.ElseIfDeclaration"/>
+  <!-- Do not add spaces after opening or before closing bracket -->
+  <rule ref="PSR2.ControlStructures.ControlStructureSpacing"/>
   <!-- Add a new line at the end of a file -->
   <rule ref="PSR2.Files.EndFileNewline"/>
+  <!-- Add space after closing parenthesis -->
+  <!-- Add body into new line -->
+  <!-- Close body in new line -->
+  <rule ref="Squiz.ControlStructures.ControlSignature">
+    <!-- No space after keyword (before opening parenthesis) -->
+    <exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/>
+  </rule>
   <!-- When declaring a function: -->
   <!-- Do not add a space before a comma -->
   <!-- Add a space after a comma -->