Verified Commit a0503e22 authored by quietone's avatar quietone
Browse files

Issue #3498059 by mstrelan, shalini_jha, hetal.solanki: Add array return to...

Issue #3498059 by mstrelan, shalini_jha, hetal.solanki: Add array return to all hook_requirements implementations
parent 1da8aa09
Loading
Loading
Loading
Loading
Loading
+0 −114
Changes for core/.phpstan-baseline.php: 0 added lines, 114 removed lines.
Original line number Diff line number Diff line
@@ -19273,12 +19273,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/field_ui/tests/src/Unit/FieldUiTableTest.php',
];
$ignoreErrors[] = [
	'message' => '#^Function file_requirements\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/modules/file/file.install',
];
$ignoreErrors[] = [
	'message' => '#^Function file_managed_file_submit\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
@@ -20881,12 +20875,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/history/tests/src/Functional/HistoryTest.php',
];
$ignoreErrors[] = [
	'message' => '#^Function image_requirements\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/modules/image/image.install',
];
$ignoreErrors[] = [
	'message' => '#^Function image_path_flush\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
@@ -21571,12 +21559,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/inline_form_errors/src/RenderElementHelper.php',
];
$ignoreErrors[] = [
	'message' => '#^Function jsonapi_requirements\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/modules/jsonapi/jsonapi.install',
];
$ignoreErrors[] = [
	'message' => '#^Method Drupal\\\\jsonapi\\\\Access\\\\EntityAccessChecker\\:\\:setLatestRevisionCheck\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
@@ -24679,12 +24661,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/layout_builder/tests/src/Unit/SectionTest.php',
];
$ignoreErrors[] = [
	'message' => '#^Function layout_discovery_requirements\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/modules/layout_discovery/layout_discovery.install',
];
$ignoreErrors[] = [
	'message' => '#^Method Drupal\\\\layout_discovery\\\\Hook\\\\LayoutDiscoveryHooks\\:\\:help\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
@@ -24937,12 +24913,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/locale/locale.compare.inc',
];
$ignoreErrors[] = [
	'message' => '#^Function locale_requirements\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/modules/locale/locale.install',
];
$ignoreErrors[] = [
	'message' => '#^Function _locale_parse_js_file\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
@@ -25753,12 +25723,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/locale/tests/src/Unit/Menu/LocaleLocalTasksTest.php',
];
$ignoreErrors[] = [
	'message' => '#^Function media_requirements\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/modules/media/media.install',
];
$ignoreErrors[] = [
	'message' => '#^Variable \\$error in empty\\(\\) always exists and is not falsy\\.$#',
	'identifier' => 'empty.variable',
@@ -29473,12 +29437,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/migrate_drupal_ui/tests/src/FunctionalJavascript/SettingsTest.php',
];
$ignoreErrors[] = [
	'message' => '#^Function mysql_requirements\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/modules/mysql/mysql.install',
];
$ignoreErrors[] = [
	'message' => '#^Method Drupal\\\\mysql\\\\Driver\\\\Database\\\\mysql\\\\Connection\\:\\:createDatabase\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
@@ -29605,12 +29563,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/navigation/modules/navigation_top_bar/src/Hook/NavigationTopBarHooks.php',
];
$ignoreErrors[] = [
	'message' => '#^Function navigation_requirements\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/modules/navigation/navigation.install',
];
$ignoreErrors[] = [
	'message' => '#^Function navigation_post_update_set_logo_dimensions_default\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
@@ -29755,12 +29707,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/node/node.admin.inc',
];
$ignoreErrors[] = [
	'message' => '#^Function node_requirements\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/modules/node/node.install',
];
$ignoreErrors[] = [
	'message' => '#^Function _node_access_rebuild_batch_finished\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
@@ -31699,12 +31645,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/path_alias/tests/src/Unit/AliasManagerTest.php',
];
$ignoreErrors[] = [
	'message' => '#^Function pgsql_requirements\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/modules/pgsql/pgsql.install',
];
$ignoreErrors[] = [
	'message' => '#^Method Drupal\\\\pgsql\\\\Driver\\\\Database\\\\pgsql\\\\Connection\\:\\:addSavepoint\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
@@ -32695,12 +32635,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/rest/tests/src/Unit/EventSubscriber/ResourceResponseSubscriberTest.php',
];
$ignoreErrors[] = [
	'message' => '#^Function search_requirements\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/modules/search/search.install',
];
$ignoreErrors[] = [
	'message' => '#^Function search_theme_suggestions_search_result\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
@@ -35017,12 +34951,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/system/src/TimeZoneResolver.php',
];
$ignoreErrors[] = [
	'message' => '#^Function system_requirements\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/modules/system/system.install',
];
$ignoreErrors[] = [
	'message' => '#^Variable \\$directories might not be defined\\.$#',
	'identifier' => 'variable.undefined',
@@ -37461,12 +37389,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/system/tests/modules/error_test/src/Controller/ErrorTestController.php',
];
$ignoreErrors[] = [
	'message' => '#^Function experimental_module_requirements_test_requirements\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/modules/system/tests/modules/experimental_module_requirements_test/experimental_module_requirements_test.install',
];
$ignoreErrors[] = [
	'message' => '#^Method Drupal\\\\experimental_module_requirements_test\\\\Hook\\\\ExperimentalModuleRequirementsTestHooks\\:\\:help\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
@@ -38547,12 +38469,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/system/tests/modules/render_placeholder_message_test/src/RenderPlaceholderMessageTestController.php',
];
$ignoreErrors[] = [
	'message' => '#^Function requirements1_test_requirements\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/modules/system/tests/modules/requirements1_test/requirements1_test.install',
];
$ignoreErrors[] = [
	'message' => '#^Method Drupal\\\\router_test\\\\RouteTestSubscriber\\:\\:alterRoutes\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
@@ -39171,12 +39087,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/system/tests/modules/update_script_test/src/Controller/UpdateScriptTestController.php',
];
$ignoreErrors[] = [
	'message' => '#^Function update_script_test_requirements\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/modules/system/tests/modules/update_script_test/update_script_test.install',
];
$ignoreErrors[] = [
	'message' => '#^Method Drupal\\\\Tests\\\\system\\\\Functional\\\\Batch\\\\ProcessingTest\\:\\:_resultMessages\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
@@ -42555,12 +42465,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/update/update.fetch.inc',
];
$ignoreErrors[] = [
	'message' => '#^Function update_requirements\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/modules/update/update.install',
];
$ignoreErrors[] = [
	'message' => '#^Function update_manager_batch_project_get\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
@@ -54459,18 +54363,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/workspaces/tests/src/Kernel/WorkspacesFileItemTest.php',
];
$ignoreErrors[] = [
	'message' => '#^Function workspaces_requirements\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/modules/workspaces/workspaces.install',
];
$ignoreErrors[] = [
	'message' => '#^Function demo_umami_requirements\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/profiles/demo_umami/demo_umami.install',
];
$ignoreErrors[] = [
	'message' => '#^Method Drupal\\\\demo_umami_content\\\\InstallHelper\\:\\:create\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
@@ -54651,12 +54543,6 @@
	'count' => 1,
	'path' => __DIR__ . '/profiles/tests/testing/modules/drupal_system_listing_compatible_test/tests/src/Kernel/SystemListingCrossProfileCompatibleTest.php',
];
$ignoreErrors[] = [
	'message' => '#^Function testing_requirements_requirements\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
	'count' => 1,
	'path' => __DIR__ . '/profiles/tests/testing_requirements/testing_requirements.install',
];
$ignoreErrors[] = [
	'message' => '#^Function simpletest_script_execute_batch\\(\\) has no return type specified\\.$#',
	'identifier' => 'missingType.return',
+1 −1
Changes for core/lib/Drupal/Core/Extension/module.api.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -1119,7 +1119,7 @@ function hook_updater_info_alter(&$updaters) {
 *     - REQUIREMENT_ERROR: The requirement failed with an error.
 *     Defaults to REQUIREMENT_OK when installing, REQUIREMENT_INFO otherwise.
 */
function hook_requirements($phase) {
function hook_requirements($phase): array {
  $requirements = [];

  // Report Drupal version
+1 −1
Changes for core/modules/file/file.install: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ function file_schema(): array {
 *
 * Display information about getting upload progress bars working.
 */
function file_requirements($phase) {
function file_requirements($phase): array {
  $requirements = [];

  if ($phase != 'runtime') {
+1 −1
Changes for core/modules/image/image.install: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ function image_uninstall(): void {
/**
 * Implements hook_requirements().
 */
function image_requirements($phase) {
function image_requirements($phase): array {
  if ($phase != 'runtime') {
    return [];
  }
+1 −1
Changes for core/modules/jsonapi/jsonapi.install: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ function jsonapi_install(): void {
/**
 * Implements hook_requirements().
 */
function jsonapi_requirements($phase) {
function jsonapi_requirements($phase): array {
  $requirements = [];
  if ($phase === 'runtime') {
    $module_handler = \Drupal::moduleHandler();
Loading