Skip to content

Commit

Permalink
Dev More brace fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
scrutinizer-auto-fixer authored and c-schmitz committed Nov 23, 2017
1 parent 88a857b commit 216079c
Show file tree
Hide file tree
Showing 36 changed files with 1,685 additions and 1,631 deletions.
4 changes: 2 additions & 2 deletions application/commands/FlushAssetsCommand.php
Expand Up @@ -21,15 +21,15 @@ class FlushAssetsCommand extends CConsoleCommand
public function run($aArguments)
{
$sCurrentDir = dirname(__FILE__);
$tmpFolder = realpath( $sCurrentDir.'/../../tmp/' );
$tmpFolder = realpath($sCurrentDir.'/../../tmp/');
echo "Flushing assets in ".$tmpFolder;
echo "\n";

$this->_sureRemoveFiles($tmpFolder.'/assets/', false, ['index.html']);
$this->_sureRemoveFiles($tmpFolder.'/runtime/cache/', false, ['index.html']);

}
private function _sureRemoveFiles($dir, $DeleteMe, $exclude = array() ) {
private function _sureRemoveFiles($dir, $DeleteMe, $exclude = array()) {
if (!$dh = @opendir($dir)) {
return;
}
Expand Down
4 changes: 3 additions & 1 deletion application/commands/console.php
Expand Up @@ -15,7 +15,9 @@
* File edited by Sam Mousa for Marcel Minke.
* This loader bypasses the default Yii loader and loads a custom console class instead.
*/
if (!isset($argv[0])) die();
if (!isset($argv[0])) {
die();
}
define('BASEPATH', '.');
require_once __DIR__.'/../../third_party/autoload.php';
require_once(dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'framework'.DIRECTORY_SEPARATOR.'yii.php');
Expand Down
4 changes: 3 additions & 1 deletion application/commands/starter.php
Expand Up @@ -12,7 +12,9 @@
* See COPYRIGHT.php for copyright notices and details.
*
*/
if (!isset($argv[0])) die();
if (!isset($argv[0])) {
die();
}
define('BASEPATH', '.');
$sCurrentDir = dirname(__FILE__);
$config = require (dirname($sCurrentDir).DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');
Expand Down
7 changes: 4 additions & 3 deletions application/config/config-defaults.php
@@ -1,4 +1,6 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
<?php if (!defined('BASEPATH')) {
exit('No direct script access allowed');
}
/*
* LimeSurvey
* Copyright (C) 2007-2011 The LimeSurvey Project Team / Carsten Schmitz
Expand Down Expand Up @@ -602,8 +604,7 @@
if (!isset($argv[0]) && Yii::app() != null)
{
$config['publicurl'] = Yii::app()->baseUrl.'/'; // The public website location (url) of the public survey script
}
else
} else
{
$config['publicurl'] = '/';
}
Expand Down
4 changes: 3 additions & 1 deletion application/config/routes.php
@@ -1,4 +1,6 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
<?php if (!defined('BASEPATH')) {
exit('No direct script access allowed');
}
/*
* LimeSurvey
* Copyright (C) 2007-2011 The LimeSurvey Project Team / Carsten Schmitz
Expand Down
50 changes: 24 additions & 26 deletions application/controllers/AdminController.php
Expand Up @@ -64,20 +64,17 @@ public function error($message, $sURL = array())
if (!empty($sURL) && !is_array($sURL))
{
$sTitle = gT('Back');
}
elseif (!empty($sURL['url']))
} elseif (!empty($sURL['url']))
{
if (!empty($sURL['title']))
{
$sTitle = $sURL['title'];
}
else
} else
{
$sTitle = gT('Back');
}
$sURL = $sURL['url'];
}
else
} else
{
$sTitle = gT('Main Admin Screen');
$sURL = $this->createUrl('/admin');
Expand Down Expand Up @@ -147,8 +144,9 @@ public function run($action)
{
if (empty($this->user_id) && $action != "authentication" && $action != "remotecontrol")
{
if (!empty($action) && $action != 'index')
Yii::app()->session['redirect_after_login'] = $this->createUrl('/');
if (!empty($action) && $action != 'index') {
Yii::app()->session['redirect_after_login'] = $this->createUrl('/');
}

App()->user->setReturnUrl(App()->request->requestUri);

Expand All @@ -161,8 +159,7 @@ public function run($action)
}

$this->redirect(array('/admin/authentication/sa/login'));
}
elseif (!empty($this->user_id) && $action != "remotecontrol")
} elseif (!empty($this->user_id) && $action != "remotecontrol")
{
if (Yii::app()->session['session_hash'] != hash('sha256', getGlobalSetting('SessionName').Yii::app()->user->getName().Yii::app()->user->getId()))
{
Expand Down Expand Up @@ -263,10 +260,11 @@ public function _GetSessionUserRights($loginID)

$oUser = User::model()->findByAttributes(array('parent_id' => 0));

if (!is_null($oUser) && $oUser->uid == $loginID)
Yii::app()->session['USER_RIGHT_INITIALSUPERADMIN'] = 1;
else
Yii::app()->session['USER_RIGHT_INITIALSUPERADMIN'] = 0;
if (!is_null($oUser) && $oUser->uid == $loginID) {
Yii::app()->session['USER_RIGHT_INITIALSUPERADMIN'] = 1;
} else {
Yii::app()->session['USER_RIGHT_INITIALSUPERADMIN'] = 0;
}
}

/**
Expand Down Expand Up @@ -294,8 +292,7 @@ public function _getAdminHeader($meta = false, $return = false)
{
$aData['languageRTL'] = " dir=\"rtl\" ";
$aData['bIsRTL'] = true;
}
else
} else
{
$aData['languageRTL'] = " dir=\"ltr\" ";
$aData['bIsRTL'] = false;
Expand All @@ -313,8 +310,9 @@ public function _getAdminHeader($meta = false, $return = false)
$aData['sitename'] = Yii::app()->getConfig("sitename");
$aData['firebug'] = useFirebug();

if (!empty(Yii::app()->session['dateformat']))
$aData['formatdata'] = getDateFormatData(Yii::app()->session['dateformat']);
if (!empty(Yii::app()->session['dateformat'])) {
$aData['formatdata'] = getDateFormatData(Yii::app()->session['dateformat']);
}

// Register admin theme package with asset manager
$oAdminTheme = AdminTheme::getInstance();
Expand All @@ -332,8 +330,7 @@ public function _getAdminHeader($meta = false, $return = false)
if ($return)
{
return $sOutput;
}
else
} else
{
echo $sOutput;
}
Expand Down Expand Up @@ -363,8 +360,7 @@ public function _getAdminFooter($url, $explanation, $return = false)
$aData['versionnumber'] = "";
$aData['versiontitle'] = "";
$aData['buildtext'] = "";
}
else
} else
{
$aData['versiontitle'] = gT('Version');
}
Expand Down Expand Up @@ -396,11 +392,13 @@ public function _showMessageBox($title, $message, $class = "message-box-error")
public function _loadEndScripts()
{
static $bRendered = false;
if ($bRendered)
return true;
if ($bRendered) {
return true;
}
$bRendered = true;
if (empty(Yii::app()->session['metaHeader']))
Yii::app()->session['metaHeader'] = '';
if (empty(Yii::app()->session['metaHeader'])) {
Yii::app()->session['metaHeader'] = '';
}

unset(Yii::app()->session['metaHeader']);

Expand Down

0 comments on commit 216079c

Please sign in to comment.