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

Commit 067197d

Browse files
Jamie SnapeStyleCIBot
authored andcommitted
Applied fixes from StyleCI
1 parent d32faa6 commit 067197d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+90
-92
lines changed

core/ApiController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ protected function _exceptionHandler(Exception $exception)
102102
* @param null|string $moduleName module from which to get the ApiComponent
103103
* @param bool $rpcStyle wrap data in RPC-style "data" and "msg" fields
104104
*
105-
* {@example
106-
* _genericAction(array('id' => 2), 'get', $apiFunctionArray) is called and
105+
* {@example * _genericAction(array('id' => 2), 'get', $apiFunctionArray) is called and
107106
* $apiFunctionArray is $apiFunctions = array('default' => 'itemMove',
108107
* 'move' => 'itemMove',
109108
* 'duplicate' => 'itemDuplicate');

core/controllers/AdminController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ public function indexAction()
249249
}
250250
$modulesList[$category][$k] = $module;
251251
if ($module->dbOk && $module->dependenciesExist) {
252-
$countModules[$category]['visible']++;
252+
++$countModules[$category]['visible'];
253253
} else {
254-
$countModules[$category]['hidden']++;
254+
++$countModules[$category]['hidden'];
255255
}
256256
}
257257

@@ -396,7 +396,7 @@ public function serversidefilechooserAction()
396396
$files = array();
397397
if (strpos(strtolower(PHP_OS), 'win') === 0) {
398398
$files = array();
399-
for ($c = 'A'; $c <= 'Z'; $c++) {
399+
for ($c = 'A'; $c <= 'Z'; ++$c) {
400400
if (is_dir($c.':')) {
401401
$files[] = $c.':';
402402
}

core/controllers/BrowseController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ public function getfolderscontentAction()
343343
$itemCount = count($items);
344344
if ($limit > 0 && $itemCount > $itemLimit) {
345345
array_pop($items);
346-
$itemCount--;
346+
--$itemCount;
347347
$showMoreLink = true;
348348
}
349349
$itemOffset += min($limit, $itemCount);

core/controllers/ImportController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private function _recursiveCountFiles($path)
9393
if ($fileInfo->isDir()) {
9494
$initialcount += $this->_recursiveCountFiles($fileInfo->getPathName());
9595
} else {
96-
$initialcount++;
96+
++$initialcount;
9797
}
9898
}
9999

@@ -114,7 +114,7 @@ private function _checkStopImport()
114114
/** Increment the number of files processed and write the progress if needed */
115115
private function _incrementFileProcessed()
116116
{
117-
$this->nfilesprocessed++;
117+
++$this->nfilesprocessed;
118118
$percent = ($this->nfilesprocessed / $this->ntotalfiles) * 100;
119119
$count = 2; // every 2%
120120
if ($percent % $count == 0) {

core/controllers/ItemController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public function viewAction()
181181
unset($tmp[$key]);
182182
continue;
183183
}
184-
$i++;
184+
++$i;
185185
if ($i > 4) {
186186
unset($tmp[$key]);
187187
}

core/controllers/SearchController.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ public function liveAction()
199199
if (!isset($folderDao->count) || $folderDao->count == 1) {
200200
$result['folderid'] = $folderDao->getFolderId();
201201
}
202-
$id++;
203-
$n++;
202+
++$id;
203+
++$n;
204204
$results[] = $result;
205205
}
206206

@@ -224,8 +224,8 @@ public function liveAction()
224224
if (!isset($itemDao->count) || $itemDao->count == 1) {
225225
$result['itemid'] = $itemDao->getItemId();
226226
}
227-
$id++;
228-
$n++;
227+
++$id;
228+
++$n;
229229
$results[] = $result;
230230
}
231231
// Groups
@@ -242,8 +242,8 @@ public function liveAction()
242242
'groupid' => $groupDao->getKey(),
243243
'category' => $this->t('Groups'),
244244
);
245-
$id++;
246-
$n++;
245+
++$id;
246+
++$n;
247247
}
248248

249249
// Community
@@ -266,8 +266,8 @@ public function liveAction()
266266
if (!isset($communityDao->count) || $communityDao->count == 1) {
267267
$result['communityid'] = $communityDao->getKey();
268268
}
269-
$id++;
270-
$n++;
269+
++$id;
270+
++$n;
271271
$results[] = $result;
272272
}
273273

@@ -287,8 +287,8 @@ public function liveAction()
287287
if (!isset($userDao->count) || $userDao->count == 1) {
288288
$result['userid'] = $userDao->getKey();
289289
}
290-
$id++;
291-
$n++;
290+
++$id;
291+
++$n;
292292
$results[] = $result;
293293
}
294294
// Other live search options

core/controllers/components/DateComponent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public static function ago($timestamp, $onlyTime = false)
6161
$periods = array('second', 'minute', 'hour', 'day', 'week', 'month', 'year', 'decade');
6262
$periodsFr = array('seconde', 'minute', 'heure', 'jour', 'semaine', 'mois', 'annee', 'decades');
6363
$lengths = array('60', '60', '24', '7', '4.35', '12', '10');
64-
for ($j = 0; $difference >= $lengths[$j]; $j++) {
64+
for ($j = 0; $difference >= $lengths[$j]; ++$j) {
6565
$difference /= $lengths[$j];
6666
}
6767
$difference = round($difference);
@@ -106,7 +106,7 @@ public static function duration($timestamp)
106106
$periods = array('second', 'minute', 'hour', 'day', 'week', 'month', 'year', 'decade');
107107
$periodsFr = array('seconde', 'minute', 'heure', 'jour', 'semaine', 'mois', 'annee', 'decades');
108108
$lengths = array('60', '60', '24', '7', '4.35', '12', '10');
109-
for ($j = 0; $difference >= $lengths[$j]; $j++) {
109+
for ($j = 0; $difference >= $lengths[$j]; ++$j) {
110110
$difference /= $lengths[$j];
111111
}
112112
$difference = round($difference);

core/controllers/components/ExportComponent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function exportBitstreams($userDao, $targetDir, $itemIds, $shouldSymLink)
7979
// Get items
8080
$revisions = array();
8181
if (!is_array($itemIds)) {
82-
throw new Zend_Exception("Input parameter \$itemIds should be an array.");
82+
throw new Zend_Exception('Input parameter $itemIds should be an array.');
8383
}
8484
if (!empty($itemIds)) {
8585
foreach ($itemIds as $itemId) {

core/controllers/components/PolicyComponent.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function applyPoliciesRecursive(
5858
}
5959
if (!$this->Folder->policyCheck($subfolder, $user, MIDAS_POLICY_ADMIN)
6060
) {
61-
$results['failure']++;
61+
++$results['failure'];
6262
continue;
6363
}
6464
// delete all existing policies on the subfolder
@@ -84,7 +84,7 @@ public function applyPoliciesRecursive(
8484
$folderPolicyUser->getPolicy()
8585
);
8686
}
87-
$results['success']++;
87+
++$results['success'];
8888
$results = $this->applyPoliciesRecursive($subfolder, $user, $progress, $results);
8989
}
9090

@@ -95,7 +95,7 @@ public function applyPoliciesRecursive(
9595
$this->Progress->updateProgress($progress, $current, $message);
9696
}
9797
if (!$this->Item->policyCheck($item, $user, MIDAS_POLICY_ADMIN)) {
98-
$results['failure']++;
98+
++$results['failure'];
9999
continue;
100100
}
101101
// delete all existing policies on the item
@@ -121,7 +121,7 @@ public function applyPoliciesRecursive(
121121
$folderPolicyUser->getPolicy()
122122
);
123123
}
124-
$results['success']++;
124+
++$results['success'];
125125
}
126126

127127
return $results;

core/controllers/components/UtilityComponent.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,16 @@ public static function extractPathParams()
106106
$tokens = array();
107107
$i = 0;
108108
if ($request->getModuleName() != 'default') {
109-
$i++;
109+
++$i;
110110
}
111111
if ($request->getControllerName() != 'index') {
112-
$i++;
112+
++$i;
113113
}
114114
if ($request->getActionName() != 'index') {
115-
$i++;
115+
++$i;
116116
}
117117
$max = count($allTokens);
118-
for (; $i < $max; $i++) {
118+
for (; $i < $max; ++$i) {
119119
$tokens[] = $allTokens[$i];
120120
}
121121

0 commit comments

Comments
 (0)