From e42994ac7a54a76cc80bbbbf42c12adde8ca9200 Mon Sep 17 00:00:00 2001 From: Anvit Srivastav Date: Thu, 10 Oct 2024 14:57:01 -0700 Subject: [PATCH] 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. --- .php-cs-fixer.dist.php | 63 +- .../modules/actor/templates/_actions.php | 2 +- .../modules/actor/templates/_occupations.php | 3 +- .../admin/actions/error404Action.class.php | 4 +- .../translatePermissionAction.class.php | 4 +- .../clipboard/actions/exportAction.class.php | 10 +- .../clipboard/actions/viewAction.class.php | 1 + .../actions/fullTreeViewAction.class.php | 6 +- .../editRepresentationComponent.class.php | 4 +- .../actions/imageflowComponent.class.php | 3 +- .../actions/metadataComponent.class.php | 13 +- .../function/actions/browseAction.class.php | 1 + .../actions/calculateDatesAction.class.php | 2 +- .../actions/findingAidComponent.class.php | 1 + .../actions/inventoryAction.class.php | 1 + .../informationobject/templates/_actions.php | 6 +- .../templates/_alternativeIdentifiers.php | 3 +- .../templates/boxLabelSuccess.php | 3 +- .../templates/itemOrFileListSuccess.php | 3 +- .../templates/storageLocationsSuccess.php | 3 +- .../modules/menu/templates/listSuccess.php | 2 +- .../actions/validateCsvAction.class.php | 4 +- .../qubit/modules/object/templates/_notes.php | 3 +- .../actions/browseAction.class.php | 2 +- .../templates/boxListSuccess.php | 3 +- .../right/actions/editAction.class.php | 6 +- .../actions/browseAction.class.php | 1 + .../term/actions/treeViewAction.class.php | 2 +- .../actions/indexActorAclAction.class.php | 2 +- .../user/actions/readOnlyAction.class.php | 4 +- composer.json | 2 +- composer.lock | 2226 +++++++++-------- lib/CsvImportAuditer.class.php | 2 +- lib/CsvImportValidator.class.php | 4 +- lib/PhysicalobjectCsvImporter.class.php | 12 +- lib/QubitFindingAidGenerator.class.php | 2 +- lib/QubitFlatfileImport.class.php | 6 +- lib/QubitLftSyncer.class.php | 3 +- lib/QubitMetsParser.class.php | 12 +- ...tPhysicalObjectCsvHoldingsReport.class.php | 2 +- lib/QubitQuery.class.php | 4 +- lib/QubitTestFunctional.class.php | 2 +- lib/QubitXmlImport.class.php | 18 +- lib/arInstall.class.php | 12 +- lib/debug/arWebDebugPanel.class.php | 4 +- lib/filter/QubitTransactionFilter.class.php | 3 +- lib/flatfile/QubitFlatfileExport.class.php | 8 +- lib/helper/QubitHelper.php | 6 +- lib/job/arActorExportJob.class.php | 3 +- .../arInformationObjectExportJob.class.php | 3 +- .../arInformationObjectXmlExportJob.class.php | 4 +- lib/model/QubitActor.php | 8 +- lib/model/QubitActorI18n.php | 4 +- lib/model/QubitAuditLog.php | 4 +- lib/model/QubitClipboardSave.php | 4 +- lib/model/QubitClipboardSaveItem.php | 4 +- lib/model/QubitContactInformationI18n.php | 4 +- lib/model/QubitDigitalObject.php | 5 +- lib/model/QubitEventI18n.php | 4 +- lib/model/QubitFunctionObjectI18n.php | 4 +- lib/model/QubitGrantedRight.php | 4 +- lib/model/QubitInformationObject.php | 37 +- lib/model/QubitInformationObjectI18n.php | 4 +- lib/model/QubitJob.php | 4 +- lib/model/QubitMenuI18n.php | 4 +- lib/model/QubitNoteI18n.php | 4 +- lib/model/QubitOtherNameI18n.php | 4 +- lib/model/QubitPhysicalObject.php | 2 +- lib/model/QubitPhysicalObjectI18n.php | 4 +- lib/model/QubitPremisObject.php | 4 +- lib/model/QubitPropertyI18n.php | 4 +- lib/model/QubitRelationI18n.php | 4 +- lib/model/QubitRepository.php | 2 +- lib/model/QubitRepositoryI18n.php | 4 +- lib/model/QubitRightsHolder.php | 4 +- lib/model/QubitRightsI18n.php | 4 +- lib/model/QubitSettingI18n.php | 4 +- lib/model/QubitSlug.php | 12 +- lib/model/QubitStaticPageI18n.php | 4 +- lib/model/QubitTaxonomyI18n.php | 4 +- lib/model/QubitTerm.php | 1 + lib/model/QubitTermI18n.php | 4 +- lib/sitemap/AbstractSitemapUrl.class.php | 4 +- lib/task/export/exportBulkBaseTask.class.php | 6 +- .../csvAuthorityRecordImportTask.class.php | 3 +- lib/task/import/csvEventImportTask.class.php | 2 +- lib/task/import/csvImportBaseTask.class.php | 3 +- .../import/importDipObjectsTask.class.php | 2 +- .../csvDigitalObjectUriValidator.class.php | 2 +- lib/task/migrate/QubitMigrate.class.php | 3 +- lib/task/migrate/QubitMigrate103.class.php | 18 +- lib/task/migrate/QubitMigrate104.class.php | 20 +- lib/task/migrate/QubitMigrate105.class.php | 20 +- lib/task/migrate/QubitMigrate106.class.php | 20 +- lib/task/migrate/QubitMigrate107.class.php | 32 +- lib/task/migrate/QubitMigrate108.class.php | 28 +- lib/task/migrate/QubitMigrate109.class.php | 28 +- lib/task/migrate/QubitMigrate110.class.php | 28 +- lib/task/migrate/arUpgradeSqlTask.class.php | 8 +- lib/task/migrate/arUpgrader110.class.php | 64 +- lib/task/migrate/arUpgrader120.class.php | 17 + .../migrations/arMigration0094.class.php | 3 +- .../migrations/arMigration0099.class.php | 3 +- .../migrations/arMigration0105.class.php | 3 +- .../migrations/arMigration0106.class.php | 3 +- .../migrations/arMigration0108.class.php | 3 +- .../migrations/arMigration0109.class.php | 47 +- .../migrations/arMigration0110.class.php | 3 +- .../migrations/arMigration0117.class.php | 3 +- ...physicalObjectDeleteUnlinkedTask.class.php | 2 +- .../physicalObjectNormalizeTask.class.php | 2 +- .../tools/deleteDescriptionTask.class.php | 4 +- lib/task/tools/sitemapTask.class.php | 3 +- .../templates/_alternativeIdentifiers.php | 6 +- .../modules/accession/templates/_events.php | 6 +- .../accession/templates/indexSuccess.php | 4 +- .../modules/actor/templates/_actions.php | 2 +- .../modules/actor/templates/_occupations.php | 6 +- .../deaccession/templates/indexSuccess.php | 2 +- .../modules/digitalobject/templates/_show.php | 3 +- .../informationobject/templates/_actions.php | 6 +- .../templates/_identifierOptions.php | 6 +- .../modules/menu/templates/listSuccess.php | 2 +- .../modules/object/templates/_notes.php | 6 +- .../modules/right/templates/editSuccess.php | 3 +- .../modules/sfDcPlugin/templates/_dcDates.php | 6 +- .../modules/sfDcPlugin/templates/_dcNames.php | 6 +- .../modules/sfIsadPlugin/templates/_event.php | 6 +- .../sfIsdfPlugin/templates/indexSuccess.php | 3 +- .../sfIsdiahPlugin/templates/indexSuccess.php | 4 +- .../informationobjectsBrowseAction.class.php | 1 + plugins/qbAclPlugin/lib/QubitAcl.class.php | 7 +- .../lib/QubitAclConditionalAssert.class.php | 4 +- .../lib/model/QubitAclGroupI18n.php | 4 +- .../actions/protectedAction.class.php | 4 +- .../lib/model/QubitAccessionEventI18n.php | 4 +- .../lib/model/QubitAccessionI18n.php | 4 +- .../lib/model/QubitDeaccessionI18n.php | 4 +- .../lib/model/QubitDonor.php | 4 +- .../actions/relatedDonorAction.class.php | 3 +- .../templates/_alternativeIdentifiers.php | 3 +- .../modules/accession/templates/_events.php | 3 +- .../accession/templates/indexSuccess.php | 4 +- .../deaccession/templates/indexSuccess.php | 2 +- .../actions/primaryContactAction.class.php | 3 +- .../lib/qtPackageExtractorBase.class.php | 5 +- ...ackageExtractorChecksumException.class.php | 4 +- .../error/ErrorBadRequestSuccess.xml.php | 3 +- .../ErrorChecksumMismatchSuccess.xml.php | 3 +- .../error/ErrorContentSuccess.xml.php | 3 +- .../error/ErrorMaxUploadSizeExceeded.xml.php | 3 +- .../error/ErrorNotImplementedSuccess.xml.php | 3 +- .../error/MediationNotAllowedSuccess.xml.php | 3 +- .../error/TargetOwnerUnknown.xml.php | 3 +- .../modules/sfDcPlugin/templates/_dcDates.php | 3 +- .../modules/sfDcPlugin/templates/_dcNames.php | 3 +- plugins/sfEacPlugin/lib/sfEacPlugin.class.php | 21 +- .../sfEacPlugin/actions/indexAction.class.php | 3 +- .../sfIsaarPlugin/lib/qtIsaarCsv.class.php | 6 +- .../modules/sfIsadPlugin/templates/_event.php | 14 +- .../templates/fileListSuccess.php | 3 +- .../sfIsdfPlugin/templates/indexSuccess.php | 3 +- .../lib/sfIsdiahPlugin.class.php | 4 +- .../sfIsdiahPlugin/templates/indexSuccess.php | 4 +- .../lib/sfSkosPluginException.class.php | 4 +- plugins/sfSkosPlugin/test/unit/importTest.php | 2 +- .../lib/sfThumbnail.class.php | 8 +- .../test/unit/sfThumbnailTest.php | 12 +- .../lib/sfWebBrowser.class.php | 5 +- .../test/unit/sfWebBrowserTest.php | 2 +- test/functional/qubit/actor/addTest.php | 3 +- test/functional/qubit/actor/deleteTest.php | 3 +- test/functional/qubit/actor/editTest.php | 3 +- test/functional/qubit/actor/indexTest.php | 3 +- test/functional/qubit/advancedSearchTest.php | 45 +- .../qubit/digitalobjectActionsTest.php | 3 +- test/functional/qubit/import/eadTest.php | 3 +- .../qubit/informationObject/addTest.php | 3 +- .../qubit/informationObject/deleteTest.php | 3 +- .../qubit/informationObject/editTest.php | 3 +- .../qubit/informationObject/indexTest.php | 3 +- test/functional/qubit/loginTest.php | 15 +- test/functional/qubit/searchTest.php | 15 +- test/mock/QubitPhysicalObject.php | 8 +- test/phpunit/CsvImportAuditerTest.php | 1 + .../PhysicalObjectCsvHoldingsReportTest.php | 1 + .../phpunit/PhysicalobjectCsvImporterTest.php | 7 +- .../CsvBaseValidatorTest.php | 5 +- .../csvImportValidator/CsvColumnCountTest.php | 1 + .../csvImportValidator/CsvColumnNameTest.php | 1 + .../csvImportValidator/CsvCultureTest.php | 1 + .../CsvDigitalObjectPathTest.php | 1 + .../CsvDigitalObjectUriTest.php | 1 + .../CsvDuplicateColumnNameTest.php | 1 + .../csvImportValidator/CsvEmptyRowTest.php | 1 + .../csvImportValidator/CsvEventValuesTest.php | 1 + .../csvImportValidator/CsvFieldLengthTest.php | 1 + .../CsvFileEncodingTest.php | 1 + .../csvImportValidator/CsvLanguageTest.php | 1 + .../csvImportValidator/CsvLegacyIdTest.php | 1 + .../csvImportValidator/CsvParentTest.php | 1 + .../csvImportValidator/CsvRepoTest.php | 3 +- .../CsvSampleValuesTest.php | 1 + .../csvImportValidator/CsvScriptTest.php | 1 + .../CsvValidatorCollectionTest.php | 1 + .../CsvValidatorResultCollectionTest.php | 1 + .../CsvValidatorResultTest.php | 1 + .../csvImportValidator/CsvValidatorTest.php | 1 + test/phpunit/settingsTaskTest.php | 1 + test/unit/audit/CodeAuditTest.php | 26 +- test/unit/routingTest.php | 16 +- 211 files changed, 1818 insertions(+), 1685 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index cca061142e..fe8d353a01 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -1,28 +1,71 @@ exclude('.coverage') ->exclude('cache') + ->notPath('docker/') ->notPath('#/model/om/#') ->notPath('#/model/map/#') ->in(__DIR__) ; -// Indentation inside switch blocks and some multiline -// elements (control statements, assignments, strings) -// is not considered. See: -// https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/776 -// https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/4502 -// -// PhpCsFixer's method_argument_space default value, -// which includes ensure_fully_multiline, causes -// inconsistencies in templates. +// method_argument_space, statement_indentation +/* + * Indentation inside switch blocks and some multiline + * elements (control statements, assignments, strings) + * is not considered. See: + * https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/776 + * https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/4502 + * + * PhpCsFixer's method_argument_space default value, + * which includes ensure_fully_multiline, causes + * inconsistencies in templates. + */ + +// fully_qualified_strict_types +/* + * TODO: Currently the only cases where we don't have fully + * qualified strict types is where we reference Elastica, + * and having those helps developers quickly find locations + * where Elastica is present in the AtoM codebase outside + * plugins. When ES is no longer deeply integrated with the + * AtoM code base, this rule exception can be removed. + */ + +// string_implicit_backslashes +/* + * This breaks regex strings, and currently there are no + * options that distinguish regex strings from regular + * strings. + */ + +// no_superfluous_phpdoc_tags +/* + * This removes phpdoc where the function signature already + * includes types. Adding this exception since we still + * want to retain phpdoc specially if they include a + * description. + */ + +// multiline_whitespace_before_semicolons +/* + * This prevents semicolons to be moved to a new line in + * cases where there are chained multiline function calls. + * Adding this exception since the semicolons in new lines + * are not indented. + */ return (new PhpCsFixer\Config()) + ->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect()) ->setRules([ '@PhpCsFixer' => true, 'method_argument_space' => ['on_multiline' => 'ignore'], + 'statement_indentation' => false, + 'fully_qualified_strict_types' => false, + 'string_implicit_backslashes' => false, + 'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'], + 'no_superfluous_phpdoc_tags' => false, ]) ->setFinder($finder) ; diff --git a/apps/qubit/modules/actor/templates/_actions.php b/apps/qubit/modules/actor/templates/_actions.php index 578dcfef3b..5a650b57cb 100644 --- a/apps/qubit/modules/actor/templates/_actions.php +++ b/apps/qubit/modules/actor/templates/_actions.php @@ -2,7 +2,7 @@