Skip to content

Commit e42994a

Browse files
committed
Update composer deps and update php-cs-fixer conf
Update composer dependencies: - jasig/phpcas is no longer maintained. apereo/phpcas is the suggested replacement. - Updating to php-cs-fixer 3.64.0 introduces some new rules which would lead to changes in over ~400 files. Selectively changing or turning off some of these rules that would lead to problems.
1 parent ac57193 commit e42994a

File tree

211 files changed

+1818
-1685
lines changed

Some content is hidden

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

211 files changed

+1818
-1685
lines changed

.php-cs-fixer.dist.php

Lines changed: 53 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,71 @@
11
<?php
22

3-
// Exclude cache folder (vendor is already excluded)
3+
// Exclude cache and docker folders (vendor is already excluded)
44
// and model classes generated with Propel.
55
$finder = PhpCsFixer\Finder::create()
66
->exclude('.coverage')
77
->exclude('cache')
8+
->notPath('docker/')
89
->notPath('#/model/om/#')
910
->notPath('#/model/map/#')
1011
->in(__DIR__)
1112
;
1213

13-
// Indentation inside switch blocks and some multiline
14-
// elements (control statements, assignments, strings)
15-
// is not considered. See:
16-
// https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/776
17-
// https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/4502
18-
//
19-
// PhpCsFixer's method_argument_space default value,
20-
// which includes ensure_fully_multiline, causes
21-
// inconsistencies in templates.
14+
// method_argument_space, statement_indentation
15+
/*
16+
* Indentation inside switch blocks and some multiline
17+
* elements (control statements, assignments, strings)
18+
* is not considered. See:
19+
* https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/776
20+
* https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/4502
21+
*
22+
* PhpCsFixer's method_argument_space default value,
23+
* which includes ensure_fully_multiline, causes
24+
* inconsistencies in templates.
25+
*/
26+
27+
// fully_qualified_strict_types
28+
/*
29+
* TODO: Currently the only cases where we don't have fully
30+
* qualified strict types is where we reference Elastica,
31+
* and having those helps developers quickly find locations
32+
* where Elastica is present in the AtoM codebase outside
33+
* plugins. When ES is no longer deeply integrated with the
34+
* AtoM code base, this rule exception can be removed.
35+
*/
36+
37+
// string_implicit_backslashes
38+
/*
39+
* This breaks regex strings, and currently there are no
40+
* options that distinguish regex strings from regular
41+
* strings.
42+
*/
43+
44+
// no_superfluous_phpdoc_tags
45+
/*
46+
* This removes phpdoc where the function signature already
47+
* includes types. Adding this exception since we still
48+
* want to retain phpdoc specially if they include a
49+
* description.
50+
*/
51+
52+
// multiline_whitespace_before_semicolons
53+
/*
54+
* This prevents semicolons to be moved to a new line in
55+
* cases where there are chained multiline function calls.
56+
* Adding this exception since the semicolons in new lines
57+
* are not indented.
58+
*/
2259
return (new PhpCsFixer\Config())
60+
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
2361
->setRules([
2462
'@PhpCsFixer' => true,
2563
'method_argument_space' => ['on_multiline' => 'ignore'],
64+
'statement_indentation' => false,
65+
'fully_qualified_strict_types' => false,
66+
'string_implicit_backslashes' => false,
67+
'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'],
68+
'no_superfluous_phpdoc_tags' => false,
2669
])
2770
->setFinder($finder)
2871
;

apps/qubit/modules/actor/templates/_actions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<ul>
44

5-
<?php if (QubitAcl::check($resource, 'update') || (QubitAcl::check($resource, 'translate'))) { ?>
5+
<?php if (QubitAcl::check($resource, 'update') || QubitAcl::check($resource, 'translate')) { ?>
66
<li><?php echo link_to(__('Edit'), [$resource, 'module' => 'actor', 'action' => 'edit'], ['class' => 'c-btn c-btn-submit', 'title' => __('Edit')]); ?></li>
77
<?php } ?>
88

apps/qubit/modules/actor/templates/_occupations.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
</tr>
1111
</thead><tbody>
1212

13-
<?php $i = 0; foreach ($occupations as $item) { ?>
13+
<?php $i = 0;
14+
foreach ($occupations as $item) { ?>
1415
<?php $form->getWidgetSchema()->setNameFormat("occupations[{$i}][%s]"); ?>
1516

1617
<tr class="<?php echo 0 == $i % 2 ? 'even' : 'odd'; ?> related_obj_<?php echo $item->id; ?>">

apps/qubit/modules/admin/actions/error404Action.class.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,5 @@
1919

2020
class AdminError404Action extends sfAction
2121
{
22-
public function execute($request)
23-
{
24-
}
22+
public function execute($request) {}
2523
}

apps/qubit/modules/admin/actions/translatePermissionAction.class.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,5 @@
1919

2020
class AdminTranslatePermissionAction extends sfAction
2121
{
22-
public function execute($request)
23-
{
24-
}
22+
public function execute($request) {}
2523
}

apps/qubit/modules/clipboard/actions/exportAction.class.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ public function execute($request)
8383

8484
// Determine if there are non-visible elements that should be hidden
8585
$this->nonVisibleElementsIncluded = false;
86-
$defTemplate = sfConfig::get(('app_default_template_'.strtolower($this->objectType)));
86+
$defTemplate = sfConfig::get('app_default_template_'.strtolower($this->objectType));
8787

8888
foreach (sfConfig::getAll() as $setting => $value) {
8989
if (
90-
(false !== strpos($setting, ('app_element_visibility_'.$defTemplate)))
90+
(false !== strpos($setting, 'app_element_visibility_'.$defTemplate))
9191
&& (0 == sfConfig::get($setting))
9292
) {
9393
$this->nonVisibleElementsIncluded = true;
@@ -338,6 +338,7 @@ protected function addField($name)
338338
);
339339

340340
break;
341+
341342
// Enable field includeDescendants if:
342343
// options enabled
343344
// and, information object type
@@ -357,6 +358,7 @@ protected function addField($name)
357358
}
358359

359360
break;
361+
360362
// Enable field includeAllLevels if:
361363
// options enabled
362364
// and, information object type
@@ -372,6 +374,7 @@ protected function addField($name)
372374
}
373375

374376
break;
377+
375378
// Enable field levels if:
376379
// options enabled
377380
// and, information object type
@@ -405,6 +408,7 @@ protected function addField($name)
405408
}
406409

407410
break;
411+
408412
// Enable field includeDigitalObjects if:
409413
// digital objects are available
410414
case 'includeDigitalObjects':
@@ -429,6 +433,7 @@ protected function addField($name)
429433
}
430434

431435
break;
436+
432437
// Enable field includeDrafts if:
433438
// information object type
434439
// and, user is authenticated
@@ -451,6 +456,7 @@ protected function addField($name)
451456
}
452457

453458
break;
459+
454460
// Enable field includeNonVisibleElements if:
455461
// information object type
456462
// and, user is authenticated

apps/qubit/modules/clipboard/actions/viewAction.class.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ private function setESSort($request)
124124
$this->search->query->addSort(['referenceCode.untouched' => $request->sortDir]);
125125

126126
break;
127+
127128
// Sort by title if information object, go with authorized form of name if repository / actor
128129
case 'alphabetic':
129130
$fieldName = 'QubitInformationObject' === $this->entityType ? 'title' : 'authorizedFormOfName';

apps/qubit/modules/default/actions/fullTreeViewAction.class.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,7 @@ protected function doElasticsearchQuery($term, $options = [])
176176
return QubitSearch::getInstance()
177177
->index
178178
->getType('QubitInformationObject')
179-
->search($query->getQuery(false, false))
180-
;
179+
->search($query->getQuery(false, false));
181180
}
182181

183182
/**
@@ -239,8 +238,7 @@ protected function countChildren($id, $options = [])
239238
return QubitSearch::getInstance()
240239
->index
241240
->getType('QubitInformationObject')
242-
->count($query->getQuery(false, false))
243-
;
241+
->count($query->getQuery(false, false));
244242
}
245243

246244
/**

apps/qubit/modules/digitalobject/actions/editRepresentationComponent.class.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,5 @@
2424
*/
2525
class DigitalObjectEditRepresentationComponent extends sfComponent
2626
{
27-
public function execute($request)
28-
{
29-
}
27+
public function execute($request) {}
3028
}

apps/qubit/modules/digitalobject/actions/imageflowComponent.class.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ protected function getDescendantDigitalObjectCount()
126126
$results = QubitSearch::getInstance()
127127
->index
128128
->getType('QubitInformationObject')
129-
->search($search->getQuery(false, true))
130-
;
129+
->search($search->getQuery(false, true));
131130

132131
return $results->getTotalHits();
133132
}

apps/qubit/modules/digitalobject/actions/metadataComponent.class.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ protected function setMasterFileShowProperties()
206206
|| $this->showMasterFileMediaType
207207
|| $this->showMasterFileMimeType
208208
|| $this->showMasterFileSize
209-
|| $this->showMasterFileCreatedAt
210-
;
209+
|| $this->showMasterFileCreatedAt;
211210
}
212211

213212
protected function setReferenceCopyShowProperties()
@@ -320,9 +319,8 @@ protected function setOriginalFileShowProperties()
320319
check_field_visibility('app_element_visibility_digital_object_preservation_system_original_ingested')
321320
&& !$this->isEmpty($this->originalFileIngestedAt)
322321
);
323-
$this->showOriginalFilePermissions = (
324-
check_field_visibility('app_element_visibility_digital_object_preservation_system_original_permissions')
325-
);
322+
$this->showOriginalFilePermissions =
323+
check_field_visibility('app_element_visibility_digital_object_preservation_system_original_permissions');
326324

327325
return $this->showOriginalFileName
328326
|| $this->showOriginalFormatName
@@ -351,9 +349,8 @@ protected function setPreservationCopyShowProperties()
351349
check_field_visibility('app_element_visibility_digital_object_preservation_system_preservation_normalized')
352350
&& !$this->isEmpty($this->preservationCopyNormalizedAt)
353351
);
354-
$this->showPreservationCopyPermissions = (
355-
check_field_visibility('app_element_visibility_digital_object_preservation_system_preservation_permissions')
356-
);
352+
$this->showPreservationCopyPermissions =
353+
check_field_visibility('app_element_visibility_digital_object_preservation_system_preservation_permissions');
357354

358355
return $this->showPreservationCopyFileName
359356
|| $this->showPreservationCopyFileSize

apps/qubit/modules/function/actions/browseAction.class.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public function execute($request)
7373
switch ($request->sort) {
7474
case 'identifier':
7575
$criteria->{$sortFunction}(QubitFunctionObject::DESCRIPTION_IDENTIFIER);
76+
7677
// And then back to authorized form of name
7778
// no break
7879
case 'alphabetic':

apps/qubit/modules/informationobject/actions/calculateDatesAction.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public static function getDescendantDateTypes($resource)
9292

9393
foreach ($eventData as $event) {
9494
$eventTypeTerm = QubitTerm::getById($event['type_id']);
95-
$eventTypes[($event['type_id'])] = $eventTypeTerm->getName(['cultureFallback' => true]);
95+
$eventTypes[$event['type_id']] = $eventTypeTerm->getName(['cultureFallback' => true]);
9696
}
9797

9898
return $eventTypes;

apps/qubit/modules/informationobject/actions/findingAidComponent.class.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ public function execute($request)
131131
$this->status = $this->context->i18n->__('Uploaded');
132132

133133
break;
134+
134135
// It should never get here if we don't add more finding aid
135136
// statuses
136137
default:

apps/qubit/modules/informationobject/actions/inventoryAction.class.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ private static function getResults($resource, $limit = 10, $page = 1, $sort = nu
162162
]);
163163

164164
break;
165+
165166
// Avoid sorting when we are just counting records
166167
case null:
167168
break;

apps/qubit/modules/informationobject/templates/_actions.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<section class="actions">
22
<ul>
33

4-
<?php if (QubitAcl::check($resource, 'update') || (QubitAcl::check($resource, 'translate'))) { ?>
4+
<?php if (QubitAcl::check($resource, 'update') || QubitAcl::check($resource, 'translate')) { ?>
55
<li><?php echo link_to(__('Edit'), [$resource, 'module' => 'informationobject', 'action' => 'edit'], ['class' => 'c-btn c-btn-submit']); ?></li>
66
<?php } ?>
77

@@ -63,9 +63,9 @@
6363

6464
<li class="divider"></li>
6565

66-
<li><?php echo link_to(__('Create new rights'), [$resource, 'sf_route' => 'slug/default', 'module' => 'right', 'action' => 'edit']); ?></li>
66+
<li><?php echo link_to(__('Create new rights'), [$resource, 'sf_route' => 'slug/default', 'module' => 'right', 'action' => 'edit']); ?></li>
6767
<?php if ($resource->hasChildren()) { ?>
68-
<li><?php echo link_to(__('Manage rights inheritance'), [$resource, 'sf_route' => 'slug/default', 'module' => 'right', 'action' => 'manage']); ?></li>
68+
<li><?php echo link_to(__('Manage rights inheritance'), [$resource, 'sf_route' => 'slug/default', 'module' => 'right', 'action' => 'manage']); ?></li>
6969
<?php } ?>
7070

7171
<?php if (sfConfig::get('app_audit_log_enabled', false)) { ?>

apps/qubit/modules/informationobject/templates/_alternativeIdentifiers.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
</tr>
1414
</thead><tbody>
1515

16-
<?php $i = 0; foreach ($alternativeIdentifiers as $item) { ?>
16+
<?php $i = 0;
17+
foreach ($alternativeIdentifiers as $item) { ?>
1718
<?php $form->getWidgetSchema()->setNameFormat("alternativeIdentifiers[{$i}][%s]"); ?>
1819

1920
<tr class="<?php echo 0 == $i % 2 ? 'even' : 'odd'; ?> related_obj_<?php echo $item->id; ?>">

apps/qubit/modules/informationobject/templates/boxLabelSuccess.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
</th>
3838
</tr>
3939
</thead><tbody>
40-
<?php $row = 1; foreach ($results as $item) { ?>
40+
<?php $row = 1;
41+
foreach ($results as $item) { ?>
4142
<tr>
4243
<td>
4344
<?php echo $row++; ?>

apps/qubit/modules/informationobject/templates/itemOrFileListSuccess.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
<body>
1818
<h1 class="label"><?php echo $reportTypeLabel.$this->i18n->__(' report'); ?></h1><hr>
1919

20-
<?php $row = 1; foreach ($results as $parent => $items) { ?>
20+
<?php $row = 1;
21+
foreach ($results as $parent => $items) { ?>
2122
<h2 class="element-invisible"><?php echo $this->i18n->__('%1% hierarchy', ['%1%' => sfConfig::get('app_ui_label_informationobject')]); ?></h2>
2223
<div class="resource-hierarchy">
2324
<ul>

apps/qubit/modules/informationobject/templates/storageLocationsSuccess.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
</th>
3636
</tr>
3737
</thead><tbody>
38-
<?php $row = 1; foreach ($results as $item) { ?>
38+
<?php $row = 1;
39+
foreach ($results as $item) { ?>
3940
<tr>
4041
<td>
4142
<?php echo $row++; ?>

apps/qubit/modules/menu/templates/listSuccess.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<tr>
2424
<td<?php if (QubitMenu::ROOT_ID == $item['parentId']) { ?> style="font-weight: bold"<?php } ?>>
2525

26-
<?php echo str_repeat('&nbsp;&nbsp;', ($item['depth'] - 1)); ?>
26+
<?php echo str_repeat('&nbsp;&nbsp;', $item['depth'] - 1); ?>
2727

2828
<?php if (isset($item['prev'])) { ?>
2929
<?php echo link_to(image_tag('up.gif', ['alt' => __('Move up')]), ['module' => 'menu', 'action' => 'list', 'move' => $item['id'], 'before' => $item['prev']], ['title' => __('Move item up in list')]); ?>

apps/qubit/modules/object/actions/validateCsvAction.class.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ protected function addField($name)
5252
return parent::addField($name);
5353
}
5454

55-
protected function processField($field)
56-
{
57-
}
55+
protected function processField($field) {}
5856

5957
/**
6058
* Launch the file import background job and return.

apps/qubit/modules/object/templates/_notes.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
</tr>
2020
</thead><tbody>
2121

22-
<?php $i = 0; foreach ($notes as $item) { ?>
22+
<?php $i = 0;
23+
foreach ($notes as $item) { ?>
2324

2425
<?php $form->getWidgetSchema()->setNameFormat($arrayName."[{$i}][%s]"); ?>
2526

apps/qubit/modules/physicalobject/actions/browseAction.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function execute($request)
2929
}
3030

3131
if (sfConfig::get('app_enable_institutional_scoping')) {
32-
//remove search-realm
32+
// remove search-realm
3333
$this->context->user->removeAttribute('search-realm');
3434
}
3535

0 commit comments

Comments
 (0)