From 377737a45ddcc6b95a62a3b4291282366a7ae968 Mon Sep 17 00:00:00 2001 From: M Parker <mparker17@536298.no-reply.drupal.org> Date: Fri, 4 Apr 2025 10:51:06 -0400 Subject: [PATCH 1/2] Issue #3517435: Drop support for D8, D9, D10.0-10.3 --- structure_sync.info.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/structure_sync.info.yml b/structure_sync.info.yml index 7776f05..c3fb130 100644 --- a/structure_sync.info.yml +++ b/structure_sync.info.yml @@ -1,6 +1,6 @@ name: 'Structure Sync' description: 'Tool for syncing structural data that is stored as content.' -core_version_requirement: ^8 || ^9 || ^10 || ^11 +core_version_requirement: ^10.3 || ^11 configure: structure_sync.general.form dependencies: - drupal:taxonomy -- GitLab From a637988c3fb4c78306dba9b6870f499a664f87f7 Mon Sep 17 00:00:00 2001 From: M Parker <mparker17@536298.no-reply.drupal.org> Date: Fri, 4 Apr 2025 14:58:03 -0400 Subject: [PATCH 2/2] Issue #3517435: Fix phpcs lints now that we don't have to support PHP 7.0. --- src/Controller/BlocksController.php | 4 ++-- src/Controller/MenuLinksController.php | 4 ++-- src/Controller/TaxonomiesController.php | 4 ++-- src/StructureSyncHelper.php | 30 ++++++++++++------------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/Controller/BlocksController.php b/src/Controller/BlocksController.php index c5b918c..14f9311 100644 --- a/src/Controller/BlocksController.php +++ b/src/Controller/BlocksController.php @@ -40,7 +40,7 @@ private function getEditableConfig() { /** * Function to export custom blocks. */ - public function exportBlocks(array $form = NULL, FormStateInterface $form_state = NULL) { + public function exportBlocks(?array $form = NULL, ?FormStateInterface $form_state = NULL) { StructureSyncHelper::logMessage('Custom blocks export started'); if (is_object($form_state) && $form_state->hasValue('export_block_list')) { @@ -109,7 +109,7 @@ public function exportBlocks(array $form = NULL, FormStateInterface $form_state * an array with a key value pair for form with key 'style' and value 'full', * 'safe' or 'force' to apply that import style. */ - public function importBlocks(array $form, FormStateInterface $form_state = NULL) { + public function importBlocks(array $form, ?FormStateInterface $form_state = NULL) { StructureSyncHelper::logMessage('Custom blocks import started'); // Check if the import style has been defined in the form (state) and else diff --git a/src/Controller/MenuLinksController.php b/src/Controller/MenuLinksController.php index c049585..934cd48 100644 --- a/src/Controller/MenuLinksController.php +++ b/src/Controller/MenuLinksController.php @@ -63,7 +63,7 @@ private function getEditableConfig() { /** * Function to export menu links. */ - public function exportMenuLinks(array $form = NULL, FormStateInterface $form_state = NULL) { + public function exportMenuLinks(?array $form = NULL, ?FormStateInterface $form_state = NULL) { StructureSyncHelper::logMessage('Menu links export started'); if (is_object($form_state) && $form_state->hasValue('export_menu_list')) { @@ -166,7 +166,7 @@ public function menuTreeFlatten(array $tree) { * an array with a key value pair for form with key 'style' and value 'full', * 'safe' or 'force' to apply that import style. */ - public function importMenuLinks(array $form, FormStateInterface $form_state = NULL) { + public function importMenuLinks(array $form, ?FormStateInterface $form_state = NULL) { StructureSyncHelper::logMessage('Menu links import started'); // Check if the there is a selection made in a form for what menus need to diff --git a/src/Controller/TaxonomiesController.php b/src/Controller/TaxonomiesController.php index 1121902..0e38f4f 100644 --- a/src/Controller/TaxonomiesController.php +++ b/src/Controller/TaxonomiesController.php @@ -40,7 +40,7 @@ private function getEditableConfig() { /** * Function to export taxonomy terms. */ - public function exportTaxonomies(array $form = NULL, FormStateInterface $form_state = NULL) { + public function exportTaxonomies(?array $form = NULL, ?FormStateInterface $form_state = NULL) { StructureSyncHelper::logMessage('Taxonomies export started'); if (is_object($form_state) && $form_state->hasValue('export_voc_list')) { @@ -163,7 +163,7 @@ public function exportTaxonomies(array $form = NULL, FormStateInterface $form_st * an array with a key value pair for form with key 'style' and value 'full', * 'safe' or 'force' to apply that import style. */ - public function importTaxonomies(array $form, FormStateInterface $form_state = NULL) { + public function importTaxonomies(array $form, ?FormStateInterface $form_state = NULL) { StructureSyncHelper::logMessage('Taxonomy import started'); // Check if the import style has been defined in the form (state) and else diff --git a/src/StructureSyncHelper.php b/src/StructureSyncHelper.php index caf2fe2..cab38c5 100644 --- a/src/StructureSyncHelper.php +++ b/src/StructureSyncHelper.php @@ -15,7 +15,7 @@ class StructureSyncHelper { /** * Function to export taxonomy terms. */ - public static function exportTaxonomies(array $form = NULL, FormStateInterface $form_state = NULL) { + public static function exportTaxonomies(?array $form = NULL, ?FormStateInterface $form_state = NULL) { $taxonomiesController = new TaxonomiesController(); $taxonomiesController->exportTaxonomies($form, $form_state); } @@ -23,7 +23,7 @@ public static function exportTaxonomies(array $form = NULL, FormStateInterface $ /** * Function to export custom blocks. */ - public static function exportCustomBlocks(array $form = NULL, FormStateInterface $form_state = NULL) { + public static function exportCustomBlocks(?array $form = NULL, ?FormStateInterface $form_state = NULL) { $blocksController = new BlocksController(); $blocksController->exportBlocks($form, $form_state); } @@ -31,7 +31,7 @@ public static function exportCustomBlocks(array $form = NULL, FormStateInterface /** * Function to export menu links. */ - public static function exportMenuLinks(array $form = NULL, FormStateInterface $form_state = NULL) { + public static function exportMenuLinks(?array $form = NULL, ?FormStateInterface $form_state = NULL) { $menuLinksController = MenuLinksController::create(\Drupal::getContainer()); $menuLinksController->exportMenuLinks($form, $form_state); } @@ -43,7 +43,7 @@ public static function exportMenuLinks(array $form = NULL, FormStateInterface $f * an array with a key value pair for form with key 'style' and value 'full', * 'safe' or 'force' to apply that import style. */ - public static function importTaxonomies(array $form, FormStateInterface $form_state = NULL) { + public static function importTaxonomies(array $form, ?FormStateInterface $form_state = NULL) { $taxonomiesController = new TaxonomiesController(); $taxonomiesController->importTaxonomies($form, $form_state); } @@ -55,7 +55,7 @@ public static function importTaxonomies(array $form, FormStateInterface $form_st * an array with a key value pair for form with key 'style' and value 'full', * 'safe' or 'force' to apply that import style. */ - public static function importCustomBlocks(array $form, FormStateInterface $form_state = NULL) { + public static function importCustomBlocks(array $form, ?FormStateInterface $form_state = NULL) { $customBlocksController = new BlocksController(); $customBlocksController->importBlocks($form, $form_state); } @@ -67,7 +67,7 @@ public static function importCustomBlocks(array $form, FormStateInterface $form_ * an array with a key value pair for form with key 'style' and value 'full', * 'safe' or 'force' to apply that import style. */ - public static function importMenuLinks(array $form, FormStateInterface $form_state = NULL) { + public static function importMenuLinks(array $form, ?FormStateInterface $form_state = NULL) { $menuLinksController = MenuLinksController::create(\Drupal::getContainer()); $menuLinksController->importMenuLinks($form, $form_state); } @@ -100,7 +100,7 @@ public static function logMessage($message, $type = NULL, $context = []) { /** * Function to start importing taxonomies with the 'full' style. */ - public static function importTaxonomiesFull(array &$form, FormStateInterface $form_state = NULL) { + public static function importTaxonomiesFull(array &$form, ?FormStateInterface $form_state = NULL) { $form['style'] = 'full'; StructureSyncHelper::importTaxonomies($form, $form_state); @@ -109,7 +109,7 @@ public static function importTaxonomiesFull(array &$form, FormStateInterface $fo /** * Function to start importing taxonomies with the 'safe' style. */ - public static function importTaxonomiesSafe(array &$form, FormStateInterface $form_state = NULL) { + public static function importTaxonomiesSafe(array &$form, ?FormStateInterface $form_state = NULL) { $form['style'] = 'safe'; StructureSyncHelper::importTaxonomies($form, $form_state); @@ -118,7 +118,7 @@ public static function importTaxonomiesSafe(array &$form, FormStateInterface $fo /** * Function to start importing taxonomies with the 'force' style. */ - public static function importTaxonomiesForce(array &$form, FormStateInterface $form_state = NULL) { + public static function importTaxonomiesForce(array &$form, ?FormStateInterface $form_state = NULL) { $form['style'] = 'force'; StructureSyncHelper::importTaxonomies($form, $form_state); @@ -127,7 +127,7 @@ public static function importTaxonomiesForce(array &$form, FormStateInterface $f /** * Function to start importing custom blocks with the 'full' style. */ - public static function importCustomBlocksFull(array &$form, FormStateInterface $form_state = NULL) { + public static function importCustomBlocksFull(array &$form, ?FormStateInterface $form_state = NULL) { $form['style'] = 'full'; StructureSyncHelper::importCustomBlocks($form, $form_state); @@ -136,7 +136,7 @@ public static function importCustomBlocksFull(array &$form, FormStateInterface $ /** * Function to start importing custom blocks with the 'safe' style. */ - public static function importCustomBlocksSafe(array &$form, FormStateInterface $form_state = NULL) { + public static function importCustomBlocksSafe(array &$form, ?FormStateInterface $form_state = NULL) { $form['style'] = 'safe'; StructureSyncHelper::importCustomBlocks($form, $form_state); @@ -145,7 +145,7 @@ public static function importCustomBlocksSafe(array &$form, FormStateInterface $ /** * Function to start importing custom blocks with the 'force' style. */ - public static function importCustomBlocksForce(array &$form, FormStateInterface $form_state = NULL) { + public static function importCustomBlocksForce(array &$form, ?FormStateInterface $form_state = NULL) { $form['style'] = 'force'; StructureSyncHelper::importCustomBlocks($form, $form_state); @@ -154,7 +154,7 @@ public static function importCustomBlocksForce(array &$form, FormStateInterface /** * Function to start importing menu links with the 'full' style. */ - public static function importMenuLinksFull(array &$form, FormStateInterface $form_state = NULL) { + public static function importMenuLinksFull(array &$form, ?FormStateInterface $form_state = NULL) { $form['style'] = 'full'; StructureSyncHelper::importMenuLinks($form, $form_state); @@ -163,7 +163,7 @@ public static function importMenuLinksFull(array &$form, FormStateInterface $for /** * Function to start importing menu links with the 'safe' style. */ - public static function importMenuLinksSafe(array &$form, FormStateInterface $form_state = NULL) { + public static function importMenuLinksSafe(array &$form, ?FormStateInterface $form_state = NULL) { $form['style'] = 'safe'; StructureSyncHelper::importMenuLinks($form, $form_state); @@ -172,7 +172,7 @@ public static function importMenuLinksSafe(array &$form, FormStateInterface $for /** * Function to start importing menu links with the 'force' style. */ - public static function importMenuLinksForce(array &$form, FormStateInterface $form_state = NULL) { + public static function importMenuLinksForce(array &$form, ?FormStateInterface $form_state = NULL) { $form['style'] = 'force'; StructureSyncHelper::importMenuLinks($form, $form_state); -- GitLab