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

Issue #3483341 by mstrelan, smustgrave: Add array return type to all hook_schema implementations

parent 91fc116a
No related branches found
No related tags found
No related merge requests found
Showing
with 19 additions and 139 deletions
......@@ -12010,12 +12010,6 @@
'count' => 1,
'path' => __DIR__ . '/modules/automated_cron/src/Hook/AutomatedCronHooks.php',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function ban_schema\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/ban/ban.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Method Drupal\\\\ban\\\\BanIpManager\\:\\:banIp\\(\\) has no return type specified\\.$#',
......@@ -14044,12 +14038,6 @@
'count' => 1,
'path' => __DIR__ . '/modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function comment_schema\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/comment/comment.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function comment_uri\\(\\) has no return type specified\\.$#',
......@@ -18622,12 +18610,6 @@
'count' => 1,
'path' => __DIR__ . '/modules/datetime_range/tests/src/Functional/EntityResource/EntityTest/EntityTestDateRangeTest.php',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function dblog_schema\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/dblog/dblog.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Method Drupal\\\\dblog\\\\Form\\\\DblogClearLogConfirmForm\\:\\:create\\(\\) has no return type specified\\.$#',
......@@ -20908,12 +20890,6 @@
'count' => 1,
'path' => __DIR__ . '/modules/file/file.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function file_schema\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/file/file.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function file_managed_file_submit\\(\\) has no return type specified\\.$#',
......@@ -22432,12 +22408,6 @@
'count' => 1,
'path' => __DIR__ . '/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function help_schema\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/help/help.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Method Drupal\\\\help\\\\HelpSectionManager\\:\\:clearCachedDefinitions\\(\\) has no return type specified\\.$#',
......@@ -22618,12 +22588,6 @@
'count' => 1,
'path' => __DIR__ . '/modules/help/tests/src/Unit/HelpTopicTwigTest.php',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function history_schema\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/history/history.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function history_write\\(\\) has no return type specified\\.$#',
......@@ -25468,12 +25432,6 @@
'count' => 1,
'path' => __DIR__ . '/modules/language/tests/src/Unit/Menu/LanguageLocalTasksTest.php',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function layout_builder_schema\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/layout_builder/layout_builder.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function layout_builder_module_implements_alter\\(\\) has no return type specified\\.$#',
......@@ -27208,12 +27166,6 @@
'count' => 1,
'path' => __DIR__ . '/modules/locale/locale.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function locale_schema\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/locale/locale.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function locale_update_10300\\(\\) has no return type specified\\.$#',
......@@ -32490,12 +32442,6 @@
'count' => 1,
'path' => __DIR__ . '/modules/node/node.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function node_schema\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/node/node.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function _node_access_rebuild_batch_finished\\(\\) has no return type specified\\.$#',
......@@ -36066,12 +36012,6 @@
'count' => 1,
'path' => __DIR__ . '/modules/search/search.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function search_schema\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/search/search.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function search_theme_suggestions_search_result\\(\\) has no return type specified\\.$#',
......@@ -37026,12 +36966,6 @@
'count' => 1,
'path' => __DIR__ . '/modules/settings_tray/tests/src/Unit/Access/BlockPluginHasSettingsTrayFormAccessCheckTest.php',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function shortcut_schema\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/shortcut/shortcut.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Method Drupal\\\\shortcut\\\\Entity\\\\Shortcut\\:\\:postSave\\(\\) has no return type specified\\.$#',
......@@ -38526,12 +38460,6 @@
'count' => 1,
'path' => __DIR__ . '/modules/system/system.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function system_schema\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/system/system.install',
];
$ignoreErrors[] = [
// identifier: variable.undefined
'message' => '#^Variable \\$directories might not be defined\\.$#',
......@@ -39408,12 +39336,6 @@
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/modules/css_disable_transitions_test/src/Hook/CssDisableTransitionsTestHooks.php',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function database_test_schema\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/modules/database_test/database_test.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Method Drupal\\\\database_test\\\\Form\\\\DatabaseTestForm\\:\\:submitForm\\(\\) has no return type specified\\.$#',
......@@ -40010,12 +39932,6 @@
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/modules/entity_schema_test/src/Hook/EntitySchemaTestHooks.php',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function entity_test_schema\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/modules/entity_test/entity_test.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function _entity_test_record_hooks\\(\\) has no return type specified\\.$#',
......@@ -42229,12 +42145,6 @@
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/modules/module_test/module_test.implementations.inc',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function module_test_schema\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/modules/module_test/module_test.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function module_test_hook_info\\(\\) has no return type specified\\.$#',
......@@ -42432,12 +42342,6 @@
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/modules/performance_test/src/PerformanceDataCollector.php',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function pgsql_test_schema\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/modules/pgsql_test/pgsql_test.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Method Drupal\\\\plugin_test\\\\Hook\\\\PluginTestHooks\\:\\:pluginTestAlter\\(\\) has no return type specified\\.$#',
......@@ -43599,12 +43503,6 @@
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/modules/update_test_schema/update_test_schema.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function update_test_schema_schema\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/system/tests/modules/update_test_schema/update_test_schema.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function update_test_schema_update_8001\\(\\) has no return type specified\\.$#',
......@@ -48957,12 +48855,6 @@
'count' => 1,
'path' => __DIR__ . '/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function user_schema\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/user/user.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function _user_cancel\\(\\) has no return type specified\\.$#',
......@@ -56109,12 +56001,6 @@
'count' => 1,
'path' => __DIR__ . '/modules/views/tests/modules/views_test_data/src/Plugin/views/style/StyleTest.php',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function views_test_data_schema\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/views/tests/modules/views_test_data/views_test_data.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Method Drupal\\\\views_test_entity_reference\\\\Hook\\\\ViewsTestEntityReferenceHooks\\:\\:viewsDataAlter\\(\\) has no return type specified\\.$#',
......@@ -60177,12 +60063,6 @@
'count' => 1,
'path' => __DIR__ . '/modules/workspaces/workspaces.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function workspaces_schema\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/modules/workspaces/workspaces.install',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function demo_umami_requirements\\(\\) has no return type specified\\.$#',
......@@ -577,7 +577,7 @@ function hook_query_TAG_alter(Drupal\Core\Database\Query\AlterableInterface $que
*
* @ingroup schemaapi
*/
function hook_schema() {
function hook_schema(): array {
$schema['users_data'] = [
'description' => 'Stores module data as key/value pairs per user.',
'fields' => [
......
......@@ -8,7 +8,7 @@
/**
* Implements hook_schema().
*/
function ban_schema() {
function ban_schema(): array {
$schema['ban_ip'] = [
'description' => 'Stores banned IP addresses.',
'fields' => [
......
......@@ -33,7 +33,7 @@ function comment_install(): void {
/**
* Implements hook_schema().
*/
function comment_schema() {
function comment_schema(): array {
$schema['comment_entity_statistics'] = [
'description' => 'Maintains statistics of entity and comments posts to show "new" and "updated" flags.',
'fields' => [
......
......@@ -8,7 +8,7 @@
/**
* Implements hook_schema().
*/
function dblog_schema() {
function dblog_schema(): array {
$schema['watchdog'] = [
'description' => 'Table that contains logs of all system events.',
'fields' => [
......
......@@ -8,7 +8,7 @@
/**
* Implements hook_schema().
*/
function file_schema() {
function file_schema(): array {
$schema['file_usage'] = [
'description' => 'Track where a file is used.',
'fields' => [
......
......@@ -8,7 +8,7 @@
/**
* Implements hook_schema().
*/
function help_schema() {
function help_schema(): array {
$schema['help_search_items'] = [
'description' => 'Stores information about indexed help search items',
'fields' => [
......
......@@ -8,7 +8,7 @@
/**
* Implements hook_schema().
*/
function history_schema() {
function history_schema(): array {
$schema['history'] = [
'description' => 'A record of which {users} have read which {node}s.',
'fields' => [
......
......@@ -43,7 +43,7 @@ function layout_builder_install(): void {
/**
* Implements hook_schema().
*/
function layout_builder_schema() {
function layout_builder_schema(): array {
$schema['inline_block_usage'] = [
'description' => 'Track where a block_content entity is used.',
'fields' => [
......
......@@ -68,7 +68,7 @@ function locale_uninstall(): void {
/**
* Implements hook_schema().
*/
function locale_schema() {
function locale_schema(): array {
$schema['locales_source'] = [
'description' => 'List of English source strings.',
'fields' => [
......
......@@ -40,7 +40,7 @@ function node_requirements($phase) {
/**
* Implements hook_schema().
*/
function node_schema() {
function node_schema(): array {
$schema['node_access'] = [
'description' => 'Identifies which realm/grant pairs a user must possess in order to view, update, or delete specific nodes.',
'fields' => [
......
......@@ -8,7 +8,7 @@
/**
* Implements hook_schema().
*/
function search_schema() {
function search_schema(): array {
$schema['search_dataset'] = [
'description' => 'Stores items that will be searched.',
'fields' => [
......
......@@ -8,7 +8,7 @@
/**
* Implements hook_schema().
*/
function shortcut_schema() {
function shortcut_schema(): array {
$schema['shortcut_set_users'] = [
'description' => 'Maps users to shortcut sets.',
'fields' => [
......
......@@ -1638,7 +1638,7 @@ function system_install(): void {
/**
* Implements hook_schema().
*/
function system_schema() {
function system_schema(): array {
// @deprecated The sequences table has been deprecated in drupal:10.2.0 and is
// removed from drupal:12.0.0. See https://www.drupal.org/node/3220378.
// @todo Remove sequences table in Drupal 12. See https://www.drupal.org/i/3335756
......
......@@ -15,7 +15,7 @@
* Therefore, the schema must actually be declared in a normal module
* like any other, not directly in the test file.
*/
function database_test_schema() {
function database_test_schema(): array {
$schema['test'] = [
'description' => 'Basic test table for the database unit tests.',
'fields' => [
......
......@@ -40,7 +40,7 @@ function entity_test_install(): void {
/**
* Implements hook_schema().
*/
function entity_test_schema() {
function entity_test_schema(): array {
// Schema for simple entity.
$schema['entity_test_example'] = [
'description' => 'Stores entity_test items.',
......
......@@ -12,7 +12,7 @@
/**
* Implements hook_schema().
*/
function module_test_schema() {
function module_test_schema(): array {
$schema['module_test'] = [
'description' => 'Dummy table to test the behavior of hook_schema() during module installation.',
'fields' => [
......
......@@ -10,7 +10,7 @@
/**
* Implements hook_schema().
*/
function pgsql_test_schema() {
function pgsql_test_schema(): array {
$schema['pgsql_sequence_test'] = [
'description' => 'Test sequence changes on pgsql driver.',
'fields' => [
......
......@@ -35,7 +35,7 @@ function update_test_schema_requirements($phase) {
*
* The schema defined here will vary on state to allow for update hook testing.
*/
function update_test_schema_schema() {
function update_test_schema_schema(): array {
$schema_version = \Drupal::state()->get('update_test_schema_version', 8000);
$table = [
'fields' => [
......
......@@ -8,7 +8,7 @@
/**
* Implements hook_schema().
*/
function user_schema() {
function user_schema(): array {
$schema['users_data'] = [
'description' => 'Stores module data as key/value pairs per user.',
'fields' => [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment