Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
Ensure consistent spacing between if, for, etc. and parenthesis
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Snape committed Jun 11, 2014
1 parent c5a3b16 commit f48f6a6
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 40 deletions.
6 changes: 3 additions & 3 deletions core/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function _exceptionHandler(Exception $e)
{
$errorInfo['code'] = $e->getCode();
$errorInfo['msg'] = $e->getMessage();
switch ($errorInfo['code'])
switch($errorInfo['code'])
{
case MIDAS_INVALID_PARAMETER:
case MIDAS_INVALID_POLICY:
Expand Down Expand Up @@ -130,7 +130,7 @@ protected function _genericAction($args, $resource, $restAction, $apiFunctions,
$calledFunction = $calledFunction . 'Wrapper';
}
$resultsArray = $ApiComponent->$calledFunction($args, $userDao);
if (isset($resultsArray))
if(isset($resultsArray))
{
$apiResults['data'] = $resultsArray;
}
Expand All @@ -139,7 +139,7 @@ protected function _genericAction($args, $resource, $restAction, $apiFunctions,
$apiResults['msg'] = "succeed!"; // there is no exception if code reaches here
}
}
catch (Exception $e)
catch(Exception $e)
{
list($apiResults['error'], $httpCode) = $this->_exceptionHandler($e);
}
Expand Down
6 changes: 3 additions & 3 deletions core/constant/global.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
limitations under the License.
=========================================================================*/

if (file_exists(BASE_PATH . '/core/configs/core.local.ini'))
if(file_exists(BASE_PATH . '/core/configs/core.local.ini'))
{
define('CORE_CONFIG', BASE_PATH . '/core/configs/core.local.ini');
}
Expand All @@ -27,7 +27,7 @@
define('CORE_CONFIG', BASE_PATH . '/core/configs/core.ini');
}

if (file_exists(BASE_PATH . '/core/configs/application.local.ini'))
if(file_exists(BASE_PATH . '/core/configs/application.local.ini'))
{
define('APPLICATION_CONFIG', BASE_PATH . '/core/configs/application.local.ini');
}
Expand All @@ -36,7 +36,7 @@
define('APPLICATION_CONFIG', BASE_PATH . '/core/configs/application.ini');
}

if (file_exists(BASE_PATH . '/core/configs/database.local.ini'))
if(file_exists(BASE_PATH . '/core/configs/database.local.ini'))
{
define('DATABASE_CONFIG', BASE_PATH . '/core/configs/database.local.ini');
}
Expand Down
2 changes: 1 addition & 1 deletion core/controllers/components/ExportComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function exportBitstreams($userDao, $targetDir, $itemIds, $shouldSymLink)
}
} // end foreach($bitstreams as $bitstream)
} // end if(!empty($bitstreams))
} // end foreach ($revisions ...
} // end foreach($revisions ...
}
} // end function exportBitstreams
} // end class
2 changes: 1 addition & 1 deletion core/layouts/empty.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ echo $this->doctype()
<!-- Import CSS -->
<link rel="shortcut icon" href="<?php echo $this->coreWebroot ?>/public/images/icons/favicon.ico" />
<?php
if (Zend_Registry::get("configGlobal")->smartoptimizer == 1)
if(Zend_Registry::get("configGlobal")->smartoptimizer == 1)
{
echo '<link type="text/css" rel="stylesheet" href="'.$this->coreWebroot.'/public/css/layout/view.css,'.
'midas.empty.css,'.
Expand Down
10 changes: 5 additions & 5 deletions core/layouts/layout.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ echo $this->doctype()
<!-- Import CSS -->
<link rel="shortcut icon" href="<?php echo $this->coreWebroot ?>/public/images/icons/favicon.ico" />
<?php
if (Zend_Registry::get("configGlobal")->smartoptimizer == 1)
if(Zend_Registry::get("configGlobal")->smartoptimizer == 1)
{
echo '<link type="text/css" rel="stylesheet" href="'.$this->coreWebroot.'/public/css/layout/midas.layout.css,'.
'view.css,'.
Expand Down Expand Up @@ -170,7 +170,7 @@ echo $this->doctype()
}
else
{
if (!isset(Zend_Registry::get('configGlobal')->closeregistration) || Zend_Registry::get('configGlobal')->closeregistration == "0")
if(!isset(Zend_Registry::get('configGlobal')->closeregistration) || Zend_Registry::get('configGlobal')->closeregistration == "0")
{
echo '<a class="registerLink" href="#" > '.$this->t('Register').'</a>';
}
Expand Down Expand Up @@ -317,7 +317,7 @@ echo $this->doctype()
echo "<h1>{$this->t('Recently Viewed')}</h1>";
$recentReverse=array_reverse($this->recentItems);
echo '<ul>';
foreach ($recentReverse as $item)
foreach($recentReverse as $item)
{
if(is_array($item))
{
Expand All @@ -330,7 +330,7 @@ echo $this->doctype()
</div>
<div class="SubMainContent">
<?php
if (isset($this->header))
if(isset($this->header))
{
echo "<div class='viewHeader'><span class='headerSpan'>{$this->header} </span></div>";
}
Expand Down Expand Up @@ -367,7 +367,7 @@ echo $this->doctype()
<hr style="display: none;"/>
</div>
<?php
if (Zend_Registry::get("configGlobal")->smartoptimizer == 1)
if(Zend_Registry::get("configGlobal")->smartoptimizer == 1)
{
echo '<script type="text/javascript" src="' . $this->coreWebroot.'/public/js/layout/jquery.js,'.
'jquery-ui.js,'.
Expand Down
2 changes: 1 addition & 1 deletion core/views/admin/index.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ $this->headScript()->appendFile($this->coreWebroot . '/public/js/jquery/jquery.c
}
echo "<br/>Path: <span class='assetstorePath'>{$assetstore->getPath()}</span>";
echo "<br/>Type: ";
switch ($assetstore->getType())
switch($assetstore->getType())
{
case MIDAS_ASSETSTORE_LOCAL:
echo "Local";
Expand Down
4 changes: 2 additions & 2 deletions core/views/user/index.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $this->headScript()->appendFile($this->coreWebroot.'/public/js/jquery/jquery.for
<div class="userList">
<?php
echo "<h3 class='userSubTitle'>";
switch ($this->order)
switch($this->order)
{
case 'lastname':
echo $this->t('Alphabetic');
Expand All @@ -34,7 +34,7 @@ $this->headScript()->appendFile($this->coreWebroot.'/public/js/jquery/jquery.for
if($this->order == 'lastname')
{
echo "<a href='{$this->webroot}/user?order=lastname'>{$this->t('All')}</a> ";
for ($i = ord('A'); $i <= ord('Z'); $i++)
for($i = ord('A'); $i <= ord('Z'); $i++)
{
if($this->offset === chr($i))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function isDCMTKWorking()
$dataDictVar = $modulesConfig['dicomextractor']->dcmdictpath;
$dictPaths = explode(":", $dataDictVar);
$errorInDictVar = false;
foreach ($dictPaths as $path)
foreach($dictPaths as $path)
{
if(!is_readable($path))
{
Expand Down Expand Up @@ -257,7 +257,7 @@ public function extract($revision)
$row['value']);
}
}
catch (Zend_Exception $exc)
catch(Zend_Exception $exc)
{
echo $exc->getMessage();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ function start($args)
$incoming_dir = $serverComponent->getDefaultReceptionDir();
}
$processing_dir = $incoming_dir . PROCESSING_DIR;
if (!file_exists($processing_dir))
if(!file_exists($processing_dir))
{
KWUtils::mkDir($processing_dir, 0777);
}
$log_dir = $incoming_dir . LOG_DIR;
if (!file_exists($log_dir))
if(!file_exists($log_dir))
{
KWUtils::mkDir($log_dir, 0777);
}
Expand All @@ -128,7 +128,7 @@ function start($args)
$dcmqrscp_cmd = $args['dcmqrscp_cmd'];
}
$dcmqrscp_pacs_dir = $incoming_dir . PACS_DIR;
if (!file_exists($dcmqrscp_pacs_dir))
if(!file_exists($dcmqrscp_pacs_dir))
{
KWUtils::mkDir($dcmqrscp_pacs_dir, 0777);
}
Expand Down Expand Up @@ -158,7 +158,7 @@ function start($args)
$start_server_command_string = str_replace("'", "", $start_server_command);
return escapeshellarg($start_server_command_string);
}
if (!isset($serverComponent))
if(!isset($serverComponent))
{
$serverComponent = MidasLoader::loadComponent('Server', 'dicomserver');
}
Expand Down Expand Up @@ -211,7 +211,7 @@ function status($args)
}

$ret = array();
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
{ // currently not supported in windows
$ret['status'] = MIDAS_DICOM_SERVER_NOT_SUPPORTED;
return $ret;
Expand All @@ -227,7 +227,7 @@ function status($args)
KWUtils::exec($ps_command, $output);
$runningSCPs = 0;
$totalSCPs = 2;
foreach ($output as $line)
foreach($output as $line)
{
$fields = preg_split("/\s+/", trim($line));
$process = $fields[4];
Expand All @@ -237,7 +237,7 @@ function status($args)
# need to be updated if python script is changed
$ret['user_email'] = $fields[21];
$runningSCPs += 1;
if ($runningSCPs == $totalSCPs)
if($runningSCPs == $totalSCPs)
{
break;
}
Expand All @@ -246,7 +246,7 @@ function status($args)
{
$ret['status'] += MIDAS_DICOM_DCMQRSCP_IS_RUNNING;
$runningSCPs += 1;
if ($runningSCPs == $totalSCPs)
if($runningSCPs == $totalSCPs)
{
break;
}
Expand Down Expand Up @@ -314,7 +314,7 @@ function stop($args)
$incoming_dir = $serverComponent->getDefaultReceptionDir();
}
$log_dir = $incoming_dir . LOG_DIR;
if (!file_exists($log_dir))
if(!file_exists($log_dir))
{
KWUtils::mkDir($log_dir, 0777);
}
Expand Down
12 changes: 6 additions & 6 deletions modules/dicomserver/controllers/components/ServerComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ public function isDICOMServerWorking()
$ret['dcmqridx'] = $kwdicomextractorComponent->getApplicationStatus($dcmqridxCommand,
'dcmqridx');
$receptionDir= $modulesConfig['dicomserver']->receptiondir;
if (empty($receptionDir))
if(empty($receptionDir))
{
$receptionDir = $this->getDefaultReceptionDir();
}
$ret['Reception Directory Writable'] = array(is_writable($receptionDir));
$peer_aes = $modulesConfig['dicomserver']->peer_aes;
if (!empty($peer_aes) && strpos($peer_aes, '(') !== false && strpos($peer_aes, ')') !== false)
if(!empty($peer_aes) && strpos($peer_aes, '(') !== false && strpos($peer_aes, ')') !== false)
{
$ret['Peer AE List Not Empty'] = array(true, "At least one peer AE is given");
}
Expand All @@ -52,19 +52,19 @@ public function isDICOMServerWorking()
$status_args['storescp_cmd']= $storescpCommand;
$status_args['dcmqrscp_cmd']= $dcmqrscpCommand;
$status_results = $apiComponent->status($status_args);
if ($status_results['status'] == MIDAS_DICOM_STORESCP_IS_RUNNING + MIDAS_DICOM_DCMQRSCP_IS_RUNNING)
if($status_results['status'] == MIDAS_DICOM_STORESCP_IS_RUNNING + MIDAS_DICOM_DCMQRSCP_IS_RUNNING)
{
$ret['Status'] = array(true, "DICOM Server is running");
}
else if ($status_results['status'] == MIDAS_DICOM_STORESCP_IS_RUNNING)
else if($status_results['status'] == MIDAS_DICOM_STORESCP_IS_RUNNING)
{
$ret['Status'] = array(false, 'DICOM C-STORE receiver is running, but DICOM Query/Retrieve service are NOT running');
}
else if ($status_results['status'] == MIDAS_DICOM_DCMQRSCP_IS_RUNNING)
else if($status_results['status'] == MIDAS_DICOM_DCMQRSCP_IS_RUNNING)
{
$ret['Status'] = array(false, 'DICOM Query/Retrieve services are running, but DICOM C-STORE receiver is NOT running');
}
else if ($status_results['status'] == MIDAS_DICOM_SERVER_NOT_RUNNING)
else if($status_results['status'] == MIDAS_DICOM_SERVER_NOT_RUNNING)
{
$ret['Status'] = array(false, "DICOM Server is not running");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function extract($revision)
$MetadataModel->addMetadataValue($revision, MIDAS_METADATA_TEXT,
'misc', $name, $property);
}
catch (Zend_Exception $exc)
catch(Zend_Exception $exc)
{
echo $exc->getMessage();
}
Expand Down Expand Up @@ -87,7 +87,7 @@ public function extract($revision)
$MetadataModel->addMetadataValue($revision, MIDAS_METADATA_TEXT,
'misc', $name, $value);
}
catch (Zend_Exception $exc)
catch(Zend_Exception $exc)
{
echo $exc->getMessage();
}
Expand Down
2 changes: 1 addition & 1 deletion modules/mfa/controllers/components/OtpComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ protected function _radiusauth($otpDevice, $token)
/* this is the one time pin + 6-digit hard token or 8 digit smart token */
radius_put_attr($rh, RADIUS_USER_PASSWORD, $token);

switch (radius_send_request($rh))
switch(radius_send_request($rh))
{
case RADIUS_ACCESS_ACCEPT:
$this->getLogger()->info("MIDAS RADIUS successful authentication " .
Expand Down
8 changes: 4 additions & 4 deletions modules/scheduler/layouts/layout-disable.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ echo $this->doctype() ?>
<!-- Import CSS -->
<link rel="shortcut icon" href="<?php echo $this->coreWebroot ?>/public/images/icons/favicon.ico" />
<?php
if (Zend_Registry::get("configGlobal")->smartoptimizer == 1)
if(Zend_Registry::get("configGlobal")->smartoptimizer == 1)
{
echo '<link type="text/css" rel="stylesheet" href="' . $this->coreWebroot . '/public/css/layout/midas.layout.css,view.css,jquery-ui.css,form.css,loginForm.css,jquery.treeTable.css,jquery.cluetip.css" />';
}
Expand Down Expand Up @@ -160,7 +160,7 @@ echo $this->doctype() ?>
echo "<h1>{$this->t('Recently Viewed')}</h1>";
$recentReverse=array_reverse($this->recentItems);
echo '<ul>';
foreach ($recentReverse as $item)
foreach($recentReverse as $item)
{
echo "<li onclick=\"location.replace('{$this->webroot}/item/{$item->getKey()}');\" class='recentItem' title='". str_replace("'", '"', $item->getName())." | todo'><a href='{$this->webroot}/item/{$item->getKey()}'>".sliceRecentItem($item->getName())."</a></li>";
}
Expand All @@ -170,7 +170,7 @@ echo $this->doctype() ?>
</div>
<div class="SubMainContent">
<?php
if (isset($this->header))
if(isset($this->header))
{
echo "<div class='viewHeader'>{$this->header} </div>";
}
Expand All @@ -194,7 +194,7 @@ echo $this->doctype() ?>
<hr style="display: none;"/>
</div>
<?php
if (Zend_Registry::get("configGlobal")->smartoptimizer == 1)
if(Zend_Registry::get("configGlobal")->smartoptimizer == 1)
{
echo '<script type="text/javascript" src="' . $this->coreWebroot . '/public/js/layout/jquery.js,jquery-ui.js,midas.layout.js,jquery.treeTable.js,jquery.cluetip.js"></script>';
}
Expand Down

0 comments on commit f48f6a6

Please sign in to comment.