diff --git a/src/Controller/BlocksController.php b/src/Controller/BlocksController.php index c5b918c025edb89581dfb7ccc53ec61c78ead5dc..14f93110e79fc26b20b639ce70bb22e876272aab 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 c0495856fa79d2bb2f0739e3d73a7c799ad93eb3..934cd48b758263b330bfe94abc3847fc518e6feb 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 112190225fc28193acc3ec0d7917080e2c2c3d26..0e38f4f6b429cdc5dffb2130998eb88042acf8fe 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 caf2fe2a3eab0abf3801ec8a6da36178620e7e25..cab38c596e0156b5eac7d465abfbf7c3be6dbbbf 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); diff --git a/structure_sync.info.yml b/structure_sync.info.yml index 7776f05c121dda6c01308251365bd2fac08d4c5a..c3fb1303665d5ab8b7d0ef7e5152aae7fa5ae90b 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