Skip to content
Snippets Groups Projects
Verified Commit 671996fd authored by quietone's avatar quietone
Browse files

Issue #3490954 by nexusnovaz, mstrelan: Add return types to hook_update_N implementations

parent 8925a129
Branches
Tags
12 merge requests!11197Issue #3506427 by eduardo morales alberti: Remove responsive_image.ajax from hook,!11131[10.4.x-only-DO-NOT-MERGE]: Issue ##2842525 Ajax attached to Views exposed filter form does not trigger callbacks,!10786Issue #3490579 by shalini_jha, mstrelan: Add void return to all views...,!5423Draft: Resolve #3329907 "Test2",!3878Removed unused condition head title for views,!3818Issue #2140179: $entity->original gets stale between updates,!3478Issue #3337882: Deleted menus are not removed from content type config,!2964Issue #2865710 : Dependencies from only one instance of a widget are used in display modes,!2062Issue #3246454: Add weekly granularity to views date sort,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!617Issue #3043725: Provide a Entity Handler for user cancelation,!579Issue #2230909: Simple decimals fail to pass validation
Pipeline #371891 passed with warnings
Pipeline: drupal

#371912

    Pipeline: drupal

    #371904

      Pipeline: drupal

      #371893

        Showing with 21 additions and 140 deletions
        ......@@ -25174,12 +25174,6 @@
        'count' => 1,
        'path' => __DIR__ . '/modules/locale/locale.install',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Function locale_update_10300\\(\\) has no return type specified\\.$#',
        'count' => 1,
        'path' => __DIR__ . '/modules/locale/locale.install',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Function _locale_parse_js_file\\(\\) has no return type specified\\.$#',
        ......@@ -37784,30 +37778,6 @@
        'count' => 1,
        'path' => __DIR__ . '/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestXmlCookieTest.php',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Function entity_test_update_8001\\(\\) has no return type specified\\.$#',
        'count' => 1,
        'path' => __DIR__ . '/modules/system/tests/modules/entity_test/update/entity_definition_updates_8001.inc',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Function entity_test_update_8002\\(\\) has no return type specified\\.$#',
        'count' => 1,
        'path' => __DIR__ . '/modules/system/tests/modules/entity_test/update/entity_definition_updates_8002.inc',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Function entity_test_update_8001\\(\\) has no return type specified\\.$#',
        'count' => 1,
        'path' => __DIR__ . '/modules/system/tests/modules/entity_test/update/status_report_8001.inc',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Function entity_test_update_8002\\(\\) has no return type specified\\.$#',
        'count' => 1,
        'path' => __DIR__ . '/modules/system/tests/modules/entity_test/update/status_report_8002.inc',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Method Drupal\\\\entity_test_bundle_class\\\\Entity\\\\EntityTestBundleClass\\:\\:postCreate\\(\\) has no return type specified\\.$#',
        ......@@ -37934,72 +37904,6 @@
        'count' => 1,
        'path' => __DIR__ . '/modules/system/tests/modules/entity_test_update/src/Hook/EntityTestUpdateHooks.php',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Function equivalent_update_test_update_100000\\(\\) has no return type specified\\.$#',
        'count' => 1,
        'path' => __DIR__ . '/modules/system/tests/modules/equivalent_update_test/equivalent_update_test.install',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Function equivalent_update_test_update_100001\\(\\) has no return type specified\\.$#',
        'count' => 1,
        'path' => __DIR__ . '/modules/system/tests/modules/equivalent_update_test/equivalent_update_test.install',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Function equivalent_update_test_update_100002\\(\\) has no return type specified\\.$#',
        'count' => 1,
        'path' => __DIR__ . '/modules/system/tests/modules/equivalent_update_test/equivalent_update_test.install',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Function equivalent_update_test_update_100101\\(\\) has no return type specified\\.$#',
        'count' => 1,
        'path' => __DIR__ . '/modules/system/tests/modules/equivalent_update_test/equivalent_update_test.install',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Function equivalent_update_test_update_100201\\(\\) has no return type specified\\.$#',
        'count' => 1,
        'path' => __DIR__ . '/modules/system/tests/modules/equivalent_update_test/equivalent_update_test.install',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Function equivalent_update_test_update_100301\\(\\) has no return type specified\\.$#',
        'count' => 1,
        'path' => __DIR__ . '/modules/system/tests/modules/equivalent_update_test/equivalent_update_test.install',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Function equivalent_update_test_update_100302\\(\\) has no return type specified\\.$#',
        'count' => 1,
        'path' => __DIR__ . '/modules/system/tests/modules/equivalent_update_test/equivalent_update_test.install',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Function equivalent_update_test_update_100400\\(\\) has no return type specified\\.$#',
        'count' => 1,
        'path' => __DIR__ . '/modules/system/tests/modules/equivalent_update_test/equivalent_update_test.install',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Function equivalent_update_test_update_100401\\(\\) has no return type specified\\.$#',
        'count' => 1,
        'path' => __DIR__ . '/modules/system/tests/modules/equivalent_update_test/equivalent_update_test.install',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Function equivalent_update_test_update_100402\\(\\) has no return type specified\\.$#',
        'count' => 1,
        'path' => __DIR__ . '/modules/system/tests/modules/equivalent_update_test/equivalent_update_test.install',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Function equivalent_update_test_update_100501\\(\\) has no return type specified\\.$#',
        'count' => 1,
        'path' => __DIR__ . '/modules/system/tests/modules/equivalent_update_test/equivalent_update_test.install',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Method Drupal\\\\error_service_test\\\\Controller\\\\LonelyMonkeyController\\:\\:testBrokenClass\\(\\) has no return type specified\\.$#',
        ......@@ -38898,12 +38802,6 @@
        'count' => 1,
        'path' => __DIR__ . '/modules/system/tests/modules/module_test/src/PluginManagerCacheClearer.php',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Function new_dependency_test_update_8001\\(\\) has no return type specified\\.$#',
        'count' => 1,
        'path' => __DIR__ . '/modules/system/tests/modules/new_dependency_test/new_dependency_test.install',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Method Drupal\\\\new_dependency_test\\\\SetterInjection\\:\\:setter\\(\\) has no return type specified\\.$#',
        ......@@ -39861,24 +39759,6 @@
        'count' => 1,
        'path' => __DIR__ . '/modules/system/tests/modules/update_script_test/update_script_test.install',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Function update_script_test_update_7200\\(\\) has no return type specified\\.$#',
        'count' => 1,
        'path' => __DIR__ . '/modules/system/tests/modules/update_script_test/update_script_test.install',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Function update_script_test_update_7201\\(\\) has no return type specified\\.$#',
        'count' => 1,
        'path' => __DIR__ . '/modules/system/tests/modules/update_script_test/update_script_test.install',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Function update_script_test_update_8001\\(\\) has no return type specified\\.$#',
        'count' => 1,
        'path' => __DIR__ . '/modules/system/tests/modules/update_script_test/update_script_test.install',
        ];
        $ignoreErrors[] = [
        // identifier: missingType.return
        'message' => '#^Method Drupal\\\\Tests\\\\system\\\\Functional\\\\Batch\\\\ProcessingTest\\:\\:_resultMessages\\(\\) has no return type specified\\.$#',
        ......@@ -326,7 +326,7 @@ function locale_update_last_removed(): int {
        /**
        * Add an index on locales_location on type and name.
        */
        function locale_update_10300() {
        function locale_update_10300(): void {
        $spec = [];
        $spec['locales_location'] = [
        'description' => 'Location information for source strings.',
        ......
        ......@@ -12,7 +12,7 @@
        /**
        * Makes the 'user_id' field multiple and migrate its data.
        */
        function entity_test_update_8001() {
        function entity_test_update_8001(): void {
        // To update the field schema we need to have no field data in the storage,
        // thus we retrieve it, delete it from storage, and write it back to the
        // storage after updating the schema.
        ......
        ......@@ -12,7 +12,7 @@
        /**
        * Makes the 'user_id' field single and migrate its data.
        */
        function entity_test_update_8002() {
        function entity_test_update_8002(): void {
        // To update the field schema we need to have no field data in the storage,
        // thus we retrieve it, delete it from storage, and write it back to the
        // storage after updating the schema.
        ......
        ......@@ -10,6 +10,6 @@
        /**
        * Test update.
        */
        function entity_test_update_8001() {
        function entity_test_update_8001(): void {
        // Empty update, we just want to trigger an error in the status report.
        }
        ......@@ -12,6 +12,6 @@
        /**
        * Test update.
        */
        function entity_test_update_8002() {
        function entity_test_update_8002(): void {
        // Empty update, we just want to trigger an update run.
        }
        ......@@ -7,6 +7,7 @@
        declare(strict_types=1);
        use Drupal\Core\StringTranslation\TranslatableMarkup;
        use Drupal\Core\Update\EquivalentUpdate;
        if (\Drupal::state()->get('equivalent_update_test_last_removed', FALSE)) {
        ......@@ -23,7 +24,7 @@ function equivalent_update_test_update_last_removed(): int {
        *
        * A regular update.
        */
        function equivalent_update_test_update_100001() {
        function equivalent_update_test_update_100001(): void {
        }
        }
        ......@@ -34,7 +35,7 @@ function equivalent_update_test_update_100001() {
        *
        * Used to determine the initial schema version.
        */
        function equivalent_update_test_update_100000() {
        function equivalent_update_test_update_100000(): void {
        throw new \Exception('This code should never be reached.');
        }
        ......@@ -48,7 +49,7 @@ function equivalent_update_test_update_100000() {
        *
        * Tests that the future update 100101 can be marked as an equivalent.
        */
        function equivalent_update_test_update_100002() {
        function equivalent_update_test_update_100002(): void {
        \Drupal::service('update.update_hook_registry')->markFutureUpdateEquivalent(100101, '11.1.0');
        }
        ......@@ -61,7 +62,7 @@ function equivalent_update_test_update_100002() {
        *
        * This update will be skipped due 100002.
        */
        function equivalent_update_test_update_100101() {
        function equivalent_update_test_update_100101(): void {
        throw new \Exception('This code should never be reached.');
        }
        ......@@ -74,7 +75,7 @@ function equivalent_update_test_update_100101() {
        *
        * This update tests that updates can be skipped using inline code.
        */
        function equivalent_update_test_update_100201() {
        function equivalent_update_test_update_100201(): TranslatableMarkup|null {
        \Drupal::service('update.update_hook_registry')->markFutureUpdateEquivalent(100201, '11.1.0');
        // Test calling the getEquivalentUpdate() method in an update function to
        // ensure it correctly determines the update number.
        ......@@ -95,7 +96,7 @@ function equivalent_update_test_update_100201() {
        * This update tests that inline code can determine the update number
        * correctly and return a NULL when it does not match.
        */
        function equivalent_update_test_update_100301() {
        function equivalent_update_test_update_100301(): void {
        \Drupal::service('update.update_hook_registry')->markFutureUpdateEquivalent(100302, '11.1.0');
        // Test calling the getEquivalentUpdate() method in an update function to
        // ensure it correctly determines the update number.
        ......@@ -110,7 +111,7 @@ function equivalent_update_test_update_100301() {
        *
        * This update will be skipped by 100301.
        */
        function equivalent_update_test_update_100302() {
        function equivalent_update_test_update_100302(): void {
        throw new \Exception('This code should never be reached.');
        }
        ......@@ -123,7 +124,7 @@ function equivalent_update_test_update_100302() {
        *
        * Tests that the future update 100402 can be marked as an equivalent.
        */
        function equivalent_update_test_update_100400() {
        function equivalent_update_test_update_100400(): void {
        \Drupal::service('update.update_hook_registry')->markFutureUpdateEquivalent(100402, '11.2.0');
        }
        ......@@ -136,7 +137,7 @@ function equivalent_update_test_update_100400() {
        *
        * Tests that the future update 100402 can be marked as an equivalent again.
        */
        function equivalent_update_test_update_100401() {
        function equivalent_update_test_update_100401(): void {
        \Drupal::service('update.update_hook_registry')->markFutureUpdateEquivalent(100402, '11.2.0');
        }
        ......@@ -149,7 +150,7 @@ function equivalent_update_test_update_100401() {
        *
        * This update will be skipped by 100400 and 100401.
        */
        function equivalent_update_test_update_100402() {
        function equivalent_update_test_update_100402(): void {
        throw new \Exception('This code should never be reached.');
        }
        ......@@ -162,7 +163,7 @@ function equivalent_update_test_update_100402() {
        *
        * This update will trigger an exception because 100501 is bigger than 100302.
        */
        function equivalent_update_test_update_100501() {
        function equivalent_update_test_update_100501(): void {
        \Drupal::service('update.update_hook_registry')->markFutureUpdateEquivalent(100302, '11.1.0');
        }
        ......
        ......@@ -10,7 +10,7 @@
        /**
        * Enable the new_dependency_test_with_service module.
        */
        function new_dependency_test_update_8001() {
        function new_dependency_test_update_8001(): void {
        $services = [
        'new_dependency_test.hard_dependency',
        'new_dependency_test.optional_dependency',
        ......
        ......@@ -59,20 +59,20 @@ function update_script_test_update_last_removed(): int {
        /**
        * Dummy update_script_test update 7200.
        */
        function update_script_test_update_7200() {
        function update_script_test_update_7200(): string {
        return 'The update_script_test_update_7200() update was executed successfully.';
        }
        /**
        * Dummy update_script_test update 7201.
        */
        function update_script_test_update_7201() {
        function update_script_test_update_7201(): string {
        return 'The update_script_test_update_7201() update was executed successfully.';
        }
        /**
        * Dummy update function to run during the tests.
        */
        function update_script_test_update_8001() {
        function update_script_test_update_8001(): string {
        return 'The update_script_test_update_8001() update was executed successfully.';
        }
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Please register or to comment