From 2c0733cfc826a634516f0550cb20f4f147e9fec0 Mon Sep 17 00:00:00 2001
From: Tim van Dijen <tvdijen@gmail.com>
Date: Fri, 29 Dec 2017 20:02:35 +0100
Subject: [PATCH] PSR-2

---
 modules/portal/lib/Portal.php | 52 ++++++++++++++++++++---------------
 1 file changed, 30 insertions(+), 22 deletions(-)

diff --git a/modules/portal/lib/Portal.php b/modules/portal/lib/Portal.php
index 45d5ca595..9cb25a2c4 100644
--- a/modules/portal/lib/Portal.php
+++ b/modules/portal/lib/Portal.php
@@ -1,55 +1,65 @@
 <?php
 
-class sspmod_portal_Portal {
-	
+class sspmod_portal_Portal
+{
 	private $pages;
 	private $config;
 	
-	function __construct($pages, $config = NULL) {
+	public function __construct($pages, $config = null)
+    {
 		$this->pages = $pages;
 		$this->config = $config;
 	}
 	
-	function getTabset($thispage) {
-		if (!isset($this->config)) return NULL;
-		foreach($this->config AS $set) {
+	public function getTabset($thispage)
+    {
+		if (!isset($this->config)) {
+            return null;
+        }
+		foreach($this->config as $set) {
 			if (in_array($thispage, $set, true)) {
 				return $set;
 			}
 		}
-		return NULL;
+		return null;
 	}
 	
-	function isPortalized($thispage) {
-		
-		foreach($this->config AS $set) {
+	public function isPortalized($thispage)
+    {
+		foreach($this->config as $set) {
 			if (in_array($thispage, $set, true)) {
-				return TRUE;
+				return true;
 			}
 		}
-		return FALSE;
+		return false;
 	}
 	
-	function getLoginInfo($translator, $thispage) {
+	public function getLoginInfo($translator, $thispage)
+    {
 		$info = array('info' => '', 'translator' => $translator, 'thispage' => $thispage);
 		SimpleSAML\Module::callHooks('portalLoginInfo', $info);
 		return $info['info'];
 	}
 	
-	function getMenu($thispage) {
+	public function getMenu($thispage)
+    {
 		$config = SimpleSAML_Configuration::getInstance();
 		$t = new SimpleSAML\Locale\Translate($config);
 		$tabset = $this->getTabset($thispage);
 		$logininfo = $this->getLoginInfo($t, $thispage);
 		$text = '';
 		$text .= '<ul class="tabset_tabs ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">';
-		foreach($this->pages AS $pageid => $page) {
-			
-			if (isset($tabset) && !in_array($pageid, $tabset, TRUE)) continue;
+		foreach ($this->pages as $pageid => $page) {
+			if (isset($tabset) && !in_array($pageid, $tabset, true)) {
+                continue;
+            }
 			$name = 'uknown';
-			if (isset($page['text'])) $name = $page['text'];
-			if (isset($page['shorttext'])) $name = $page['shorttext'];
-			
+			if (isset($page['text'])) {
+                $name = $page['text'];
+            }
+			if (isset($page['shorttext'])) {
+                $name = $page['shorttext'];
+            }
 			if (!isset($page['href'])) {
 				$text .= '<li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"><a href="#">' . $t->t($name) . '</a></li>';
 			} else if($pageid === $thispage ) {
@@ -66,6 +76,4 @@ class sspmod_portal_Portal {
 
 		return $text;
 	}
-	
-	
 }
-- 
GitLab