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

Commit f48f6a6

Browse files
author
Jamie Snape
committed
Ensure consistent spacing between if, for, etc. and parenthesis
1 parent c5a3b16 commit f48f6a6

File tree

13 files changed

+40
-40
lines changed

13 files changed

+40
-40
lines changed

core/ApiController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ protected function _exceptionHandler(Exception $e)
5151
{
5252
$errorInfo['code'] = $e->getCode();
5353
$errorInfo['msg'] = $e->getMessage();
54-
switch ($errorInfo['code'])
54+
switch($errorInfo['code'])
5555
{
5656
case MIDAS_INVALID_PARAMETER:
5757
case MIDAS_INVALID_POLICY:
@@ -130,7 +130,7 @@ protected function _genericAction($args, $resource, $restAction, $apiFunctions,
130130
$calledFunction = $calledFunction . 'Wrapper';
131131
}
132132
$resultsArray = $ApiComponent->$calledFunction($args, $userDao);
133-
if (isset($resultsArray))
133+
if(isset($resultsArray))
134134
{
135135
$apiResults['data'] = $resultsArray;
136136
}
@@ -139,7 +139,7 @@ protected function _genericAction($args, $resource, $restAction, $apiFunctions,
139139
$apiResults['msg'] = "succeed!"; // there is no exception if code reaches here
140140
}
141141
}
142-
catch (Exception $e)
142+
catch(Exception $e)
143143
{
144144
list($apiResults['error'], $httpCode) = $this->_exceptionHandler($e);
145145
}

core/constant/global.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
limitations under the License.
1919
=========================================================================*/
2020

21-
if (file_exists(BASE_PATH . '/core/configs/core.local.ini'))
21+
if(file_exists(BASE_PATH . '/core/configs/core.local.ini'))
2222
{
2323
define('CORE_CONFIG', BASE_PATH . '/core/configs/core.local.ini');
2424
}
@@ -27,7 +27,7 @@
2727
define('CORE_CONFIG', BASE_PATH . '/core/configs/core.ini');
2828
}
2929

30-
if (file_exists(BASE_PATH . '/core/configs/application.local.ini'))
30+
if(file_exists(BASE_PATH . '/core/configs/application.local.ini'))
3131
{
3232
define('APPLICATION_CONFIG', BASE_PATH . '/core/configs/application.local.ini');
3333
}
@@ -36,7 +36,7 @@
3636
define('APPLICATION_CONFIG', BASE_PATH . '/core/configs/application.ini');
3737
}
3838

39-
if (file_exists(BASE_PATH . '/core/configs/database.local.ini'))
39+
if(file_exists(BASE_PATH . '/core/configs/database.local.ini'))
4040
{
4141
define('DATABASE_CONFIG', BASE_PATH . '/core/configs/database.local.ini');
4242
}

core/controllers/components/ExportComponent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ function exportBitstreams($userDao, $targetDir, $itemIds, $shouldSymLink)
185185
}
186186
} // end foreach($bitstreams as $bitstream)
187187
} // end if(!empty($bitstreams))
188-
} // end foreach ($revisions ...
188+
} // end foreach($revisions ...
189189
}
190190
} // end function exportBitstreams
191191
} // end class

core/layouts/empty.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ echo $this->doctype()
3838
<!-- Import CSS -->
3939
<link rel="shortcut icon" href="<?php echo $this->coreWebroot ?>/public/images/icons/favicon.ico" />
4040
<?php
41-
if (Zend_Registry::get("configGlobal")->smartoptimizer == 1)
41+
if(Zend_Registry::get("configGlobal")->smartoptimizer == 1)
4242
{
4343
echo '<link type="text/css" rel="stylesheet" href="'.$this->coreWebroot.'/public/css/layout/view.css,'.
4444
'midas.empty.css,'.

core/layouts/layout.phtml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ echo $this->doctype()
4040
<!-- Import CSS -->
4141
<link rel="shortcut icon" href="<?php echo $this->coreWebroot ?>/public/images/icons/favicon.ico" />
4242
<?php
43-
if (Zend_Registry::get("configGlobal")->smartoptimizer == 1)
43+
if(Zend_Registry::get("configGlobal")->smartoptimizer == 1)
4444
{
4545
echo '<link type="text/css" rel="stylesheet" href="'.$this->coreWebroot.'/public/css/layout/midas.layout.css,'.
4646
'view.css,'.
@@ -170,7 +170,7 @@ echo $this->doctype()
170170
}
171171
else
172172
{
173-
if (!isset(Zend_Registry::get('configGlobal')->closeregistration) || Zend_Registry::get('configGlobal')->closeregistration == "0")
173+
if(!isset(Zend_Registry::get('configGlobal')->closeregistration) || Zend_Registry::get('configGlobal')->closeregistration == "0")
174174
{
175175
echo '<a class="registerLink" href="#" > '.$this->t('Register').'</a>';
176176
}
@@ -317,7 +317,7 @@ echo $this->doctype()
317317
echo "<h1>{$this->t('Recently Viewed')}</h1>";
318318
$recentReverse=array_reverse($this->recentItems);
319319
echo '<ul>';
320-
foreach ($recentReverse as $item)
320+
foreach($recentReverse as $item)
321321
{
322322
if(is_array($item))
323323
{
@@ -330,7 +330,7 @@ echo $this->doctype()
330330
</div>
331331
<div class="SubMainContent">
332332
<?php
333-
if (isset($this->header))
333+
if(isset($this->header))
334334
{
335335
echo "<div class='viewHeader'><span class='headerSpan'>{$this->header} </span></div>";
336336
}
@@ -367,7 +367,7 @@ echo $this->doctype()
367367
<hr style="display: none;"/>
368368
</div>
369369
<?php
370-
if (Zend_Registry::get("configGlobal")->smartoptimizer == 1)
370+
if(Zend_Registry::get("configGlobal")->smartoptimizer == 1)
371371
{
372372
echo '<script type="text/javascript" src="' . $this->coreWebroot.'/public/js/layout/jquery.js,'.
373373
'jquery-ui.js,'.

core/views/admin/index.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ $this->headScript()->appendFile($this->coreWebroot . '/public/js/jquery/jquery.c
141141
}
142142
echo "<br/>Path: <span class='assetstorePath'>{$assetstore->getPath()}</span>";
143143
echo "<br/>Type: ";
144-
switch ($assetstore->getType())
144+
switch($assetstore->getType())
145145
{
146146
case MIDAS_ASSETSTORE_LOCAL:
147147
echo "Local";

core/views/user/index.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $this->headScript()->appendFile($this->coreWebroot.'/public/js/jquery/jquery.for
1919
<div class="userList">
2020
<?php
2121
echo "<h3 class='userSubTitle'>";
22-
switch ($this->order)
22+
switch($this->order)
2323
{
2424
case 'lastname':
2525
echo $this->t('Alphabetic');
@@ -34,7 +34,7 @@ $this->headScript()->appendFile($this->coreWebroot.'/public/js/jquery/jquery.for
3434
if($this->order == 'lastname')
3535
{
3636
echo "<a href='{$this->webroot}/user?order=lastname'>{$this->t('All')}</a> ";
37-
for ($i = ord('A'); $i <= ord('Z'); $i++)
37+
for($i = ord('A'); $i <= ord('Z'); $i++)
3838
{
3939
if($this->offset === chr($i))
4040
{

modules/dicomextractor/controllers/components/ExtractorComponent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function isDCMTKWorking()
119119
$dataDictVar = $modulesConfig['dicomextractor']->dcmdictpath;
120120
$dictPaths = explode(":", $dataDictVar);
121121
$errorInDictVar = false;
122-
foreach ($dictPaths as $path)
122+
foreach($dictPaths as $path)
123123
{
124124
if(!is_readable($path))
125125
{
@@ -257,7 +257,7 @@ public function extract($revision)
257257
$row['value']);
258258
}
259259
}
260-
catch (Zend_Exception $exc)
260+
catch(Zend_Exception $exc)
261261
{
262262
echo $exc->getMessage();
263263
}

modules/dicomserver/controllers/components/ApiserverComponent.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ function start($args)
113113
$incoming_dir = $serverComponent->getDefaultReceptionDir();
114114
}
115115
$processing_dir = $incoming_dir . PROCESSING_DIR;
116-
if (!file_exists($processing_dir))
116+
if(!file_exists($processing_dir))
117117
{
118118
KWUtils::mkDir($processing_dir, 0777);
119119
}
120120
$log_dir = $incoming_dir . LOG_DIR;
121-
if (!file_exists($log_dir))
121+
if(!file_exists($log_dir))
122122
{
123123
KWUtils::mkDir($log_dir, 0777);
124124
}
@@ -128,7 +128,7 @@ function start($args)
128128
$dcmqrscp_cmd = $args['dcmqrscp_cmd'];
129129
}
130130
$dcmqrscp_pacs_dir = $incoming_dir . PACS_DIR;
131-
if (!file_exists($dcmqrscp_pacs_dir))
131+
if(!file_exists($dcmqrscp_pacs_dir))
132132
{
133133
KWUtils::mkDir($dcmqrscp_pacs_dir, 0777);
134134
}
@@ -158,7 +158,7 @@ function start($args)
158158
$start_server_command_string = str_replace("'", "", $start_server_command);
159159
return escapeshellarg($start_server_command_string);
160160
}
161-
if (!isset($serverComponent))
161+
if(!isset($serverComponent))
162162
{
163163
$serverComponent = MidasLoader::loadComponent('Server', 'dicomserver');
164164
}
@@ -211,7 +211,7 @@ function status($args)
211211
}
212212

213213
$ret = array();
214-
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
214+
if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
215215
{ // currently not supported in windows
216216
$ret['status'] = MIDAS_DICOM_SERVER_NOT_SUPPORTED;
217217
return $ret;
@@ -227,7 +227,7 @@ function status($args)
227227
KWUtils::exec($ps_command, $output);
228228
$runningSCPs = 0;
229229
$totalSCPs = 2;
230-
foreach ($output as $line)
230+
foreach($output as $line)
231231
{
232232
$fields = preg_split("/\s+/", trim($line));
233233
$process = $fields[4];
@@ -237,7 +237,7 @@ function status($args)
237237
# need to be updated if python script is changed
238238
$ret['user_email'] = $fields[21];
239239
$runningSCPs += 1;
240-
if ($runningSCPs == $totalSCPs)
240+
if($runningSCPs == $totalSCPs)
241241
{
242242
break;
243243
}
@@ -246,7 +246,7 @@ function status($args)
246246
{
247247
$ret['status'] += MIDAS_DICOM_DCMQRSCP_IS_RUNNING;
248248
$runningSCPs += 1;
249-
if ($runningSCPs == $totalSCPs)
249+
if($runningSCPs == $totalSCPs)
250250
{
251251
break;
252252
}
@@ -314,7 +314,7 @@ function stop($args)
314314
$incoming_dir = $serverComponent->getDefaultReceptionDir();
315315
}
316316
$log_dir = $incoming_dir . LOG_DIR;
317-
if (!file_exists($log_dir))
317+
if(!file_exists($log_dir))
318318
{
319319
KWUtils::mkDir($log_dir, 0777);
320320
}

modules/dicomserver/controllers/components/ServerComponent.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ public function isDICOMServerWorking()
3434
$ret['dcmqridx'] = $kwdicomextractorComponent->getApplicationStatus($dcmqridxCommand,
3535
'dcmqridx');
3636
$receptionDir= $modulesConfig['dicomserver']->receptiondir;
37-
if (empty($receptionDir))
37+
if(empty($receptionDir))
3838
{
3939
$receptionDir = $this->getDefaultReceptionDir();
4040
}
4141
$ret['Reception Directory Writable'] = array(is_writable($receptionDir));
4242
$peer_aes = $modulesConfig['dicomserver']->peer_aes;
43-
if (!empty($peer_aes) && strpos($peer_aes, '(') !== false && strpos($peer_aes, ')') !== false)
43+
if(!empty($peer_aes) && strpos($peer_aes, '(') !== false && strpos($peer_aes, ')') !== false)
4444
{
4545
$ret['Peer AE List Not Empty'] = array(true, "At least one peer AE is given");
4646
}
@@ -52,19 +52,19 @@ public function isDICOMServerWorking()
5252
$status_args['storescp_cmd']= $storescpCommand;
5353
$status_args['dcmqrscp_cmd']= $dcmqrscpCommand;
5454
$status_results = $apiComponent->status($status_args);
55-
if ($status_results['status'] == MIDAS_DICOM_STORESCP_IS_RUNNING + MIDAS_DICOM_DCMQRSCP_IS_RUNNING)
55+
if($status_results['status'] == MIDAS_DICOM_STORESCP_IS_RUNNING + MIDAS_DICOM_DCMQRSCP_IS_RUNNING)
5656
{
5757
$ret['Status'] = array(true, "DICOM Server is running");
5858
}
59-
else if ($status_results['status'] == MIDAS_DICOM_STORESCP_IS_RUNNING)
59+
else if($status_results['status'] == MIDAS_DICOM_STORESCP_IS_RUNNING)
6060
{
6161
$ret['Status'] = array(false, 'DICOM C-STORE receiver is running, but DICOM Query/Retrieve service are NOT running');
6262
}
63-
else if ($status_results['status'] == MIDAS_DICOM_DCMQRSCP_IS_RUNNING)
63+
else if($status_results['status'] == MIDAS_DICOM_DCMQRSCP_IS_RUNNING)
6464
{
6565
$ret['Status'] = array(false, 'DICOM Query/Retrieve services are running, but DICOM C-STORE receiver is NOT running');
6666
}
67-
else if ($status_results['status'] == MIDAS_DICOM_SERVER_NOT_RUNNING)
67+
else if($status_results['status'] == MIDAS_DICOM_SERVER_NOT_RUNNING)
6868
{
6969
$ret['Status'] = array(false, "DICOM Server is not running");
7070
}

0 commit comments

Comments
 (0)