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

Commit fbc21dc

Browse files
author
Julien Jomier
committed
STYLE: Fixed style
1 parent 20d4bea commit fbc21dc

File tree

3 files changed

+41
-34
lines changed

3 files changed

+41
-34
lines changed

core/controllers/components/MIDAS2MigrationComponent.php

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ private function _createFolderForItem($collectionId, $parentFolderid)
150150
$policyquery = pg_query("SELECT policy_id FROM resourcepolicy WHERE resource_type_id=".MIDAS2_RESOURCE_ITEM.
151151
" AND resource_id=".$item_id." AND epersongroup_id=0");
152152
$privacy = MIDAS_COMMUNITY_PRIVATE;
153-
if(pg_num_rows($policyquery)>0)
153+
if(pg_num_rows($policyquery) > 0)
154154
{
155155
$anonymousGroup = $Group->load(MIDAS_GROUP_ANONYMOUS_KEY);
156156
$Itempolicygroup->createPolicy($anonymousGroup, $itemdao, MIDAS_POLICY_READ);
@@ -402,33 +402,33 @@ private function _createFolderForCommunity($communityidMIDAS2, $parentFolderid)
402402
$Folderpolicyuser->createPolicy($user, $folderDao, $policyValue);
403403
}
404404

405-
// Add specific MIDAS policies for users (not dealing with groups)
406-
$policyquery = pg_query("SELECT max(action_id) AS actionid, eperson.eperson_id, eperson.email
405+
// Add specific MIDAS policies for users (not dealing with groups)
406+
$policyquery = pg_query("SELECT max(action_id) AS actionid, eperson.eperson_id, eperson.email
407407
FROM resourcepolicy
408408
LEFT JOIN eperson ON (eperson.eperson_id=resourcepolicy.eperson_id)
409409
WHERE epersongroup_id IS NULL AND resource_type_id=".MIDAS2_RESOURCE_COMMUNITY.
410410
" AND resource_id=".$community_id." GROUP BY eperson.eperson_id, email");
411411

412-
while($policyquery_array = pg_fetch_array($policyquery))
413-
{
414-
$actionid = $policyquery_array['actionid'];
415-
$email = $policyquery_array['email'];
416-
if($actionid > 1)
417-
{
418-
$policyValue = MIDAS_POLICY_ADMIN;
419-
}
420-
else if($actionid == 1)
421-
{
422-
$policyValue = MIDAS_POLICY_WRITE;
423-
}
424-
else
425-
{
426-
$policyValue = MIDAS_POLICY_READ;
427-
}
428-
$userDao = $User->getByEmail($email);
429-
430-
$Folderpolicyuser->createPolicy($user, $folderDao, $policyValue);
431-
}
412+
while($policyquery_array = pg_fetch_array($policyquery))
413+
{
414+
$actionid = $policyquery_array['actionid'];
415+
$email = $policyquery_array['email'];
416+
if($actionid > 1)
417+
{
418+
$policyValue = MIDAS_POLICY_ADMIN;
419+
}
420+
else if($actionid == 1)
421+
{
422+
$policyValue = MIDAS_POLICY_WRITE;
423+
}
424+
else
425+
{
426+
$policyValue = MIDAS_POLICY_READ;
427+
}
428+
$userDao = $User->getByEmail($email);
429+
430+
$Folderpolicyuser->createPolicy($user, $folderDao, $policyValue);
431+
}
432432
}
433433
catch(Zend_Exception $e)
434434
{
@@ -437,12 +437,12 @@ private function _createFolderForCommunity($communityidMIDAS2, $parentFolderid)
437437
//we continue
438438
}
439439

440-
if($folderDao) // The folder has been created for the community
440+
if($folderDao) // The folder has been created for the community
441441
{
442442
// Find the subcommunities
443443
$this->_createFolderForCommunity($community_id, $folderDao->getFolderId());
444444
}
445-
else
445+
else
446446
{
447447
echo "Cannot create Folder for community: ".$name."<br>";
448448
} // end cannot create folder

core/controllers/forms/MigrateForm.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function createMigrateForm($assetstores)
2424
$form->setAttrib('class', 'migrateForm');
2525

2626
// Input directory
27-
$midas2_hostname = new Zend_Form_Element_Text('midas2_hostname', array('label' => $this->t('MIDAS2 Hostname'), 'size' => 60,'value' => 'localhost'));
27+
$midas2_hostname = new Zend_Form_Element_Text('midas2_hostname', array('label' => $this->t('MIDAS2 Hostname'), 'size' => 60, 'value' => 'localhost'));
2828
$midas2_hostname->setRequired(true);
2929
$form->addElement($midas2_hostname);
3030

@@ -41,7 +41,7 @@ public function createMigrateForm($assetstores)
4141
$midas2_password->setRequired(true);
4242
$form->addElement($midas2_password);
4343

44-
$midas2_database = new Zend_Form_Element_Text('midas2_database', array('label' => $this->t('MIDAS2 Database'),' size' => 60, 'value' => 'midas'));
44+
$midas2_database = new Zend_Form_Element_Text('midas2_database', array('label' => $this->t('MIDAS2 Database'), ' size' => 60, 'value' => 'midas'));
4545
$midas2_database->setRequired(true);
4646
$form->addElement($midas2_database);
4747

tests/library/PhpCheckstyle/src/PHPCheckstyle.php

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,15 +1807,22 @@ private function _checkLargeLine() {
18071807
if ($this->_isActive('lineLength')) {
18081808

18091809
// Comments are ignored
1810-
if (!($this->tokenizer->checkProvidedToken($this->token, T_COMMENT) || $this->tokenizer->checkProvidedToken($this->token, T_ML_COMMENT) || $this->tokenizer->checkProvidedToken($this->token, T_DOC_COMMENT))) {
1810+
if (!($this->tokenizer->checkProvidedToken($this->token, T_COMMENT)
1811+
|| $this->tokenizer->checkProvidedToken($this->token, T_ML_COMMENT)
1812+
|| $this->tokenizer->checkProvidedToken($this->token, T_DOC_COMMENT))) {
18111813

18121814
$text = $this->tokenizer->extractTokenText($this->token);
1813-
$text = trim($text);
1814-
$maxlen = $this->_config->getTestProperty('lineLength', 'maxLineLength');
1815-
$msg = sprintf(PHPCHECKSTYLE_LONG_LINE, $maxlen);
1816-
if (strlen($text) > $maxlen) {
1817-
$this->_writeError('lineLength', $msg);
1818-
}
1815+
$textarray = explode("\r",$text);
1816+
foreach($textarray as $text)
1817+
{
1818+
$text = trim($text);
1819+
1820+
$maxlen = $this->_config->getTestProperty('lineLength', 'maxLineLength');
1821+
$msg = sprintf(PHPCHECKSTYLE_LONG_LINE, $maxlen);
1822+
if (strlen($text) > $maxlen) {
1823+
$this->_writeError('lineLength', $msg);
1824+
}
1825+
}
18191826
}
18201827
}
18211828
}

0 commit comments

Comments
 (0)