Verified Commit 11a96f26 authored by quietone's avatar quietone
Browse files

Issue #3487665 by mstrelan, nicxvan: Add void return type to all hook_cron implementations

(cherry picked from commit 416bc53a)
parent 1f96131d
Loading
Loading
Loading
Loading
Loading
+0 −90
Original line number Diff line number Diff line
@@ -11380,12 +11380,6 @@
	'count' => 1,
	'path' => __DIR__ . '/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/UniqueFieldValueValidator.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\announcements_feed\\\\Hook\\\\AnnouncementsFeedHooks\\:\\:cron\\(\\) has no return type specified\\.$#',
	'count' => 1,
	'path' => __DIR__ . '/modules/announcements_feed/src/Hook/AnnouncementsFeedHooks.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\announcements_feed\\\\Hook\\\\AnnouncementsFeedHooks\\:\\:help\\(\\) has no return type specified\\.$#',
@@ -13492,12 +13486,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/comment/src/Form/DeleteForm.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\comment\\\\Hook\\\\CommentHooks\\:\\:cron\\(\\) has no return type specified\\.$#',
	'count' => 1,
	'path' => __DIR__ . '/modules/comment/src/Hook/CommentHooks.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\comment\\\\Hook\\\\CommentHooks\\:\\:entityExtraFieldInfo\\(\\) has no return type specified\\.$#',
@@ -17434,12 +17422,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/dblog/src/Form/DblogFilterForm.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\dblog\\\\Hook\\\\DblogHooks\\:\\:cron\\(\\) has no return type specified\\.$#',
	'count' => 1,
	'path' => __DIR__ . '/modules/dblog/src/Hook/DblogHooks.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\dblog\\\\Hook\\\\DblogHooks\\:\\:help\\(\\) has no return type specified\\.$#',
@@ -17932,12 +17914,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/field/src/FieldConfigStorage.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\field\\\\Hook\\\\FieldHooks\\:\\:cron\\(\\) has no return type specified\\.$#',
	'count' => 1,
	'path' => __DIR__ . '/modules/field/src/Hook/FieldHooks.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\field\\\\Hook\\\\FieldHooks\\:\\:entityBundleDelete\\(\\) has no return type specified\\.$#',
@@ -19672,12 +19648,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/file/src/FileUsage/FileUsageInterface.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\file\\\\Hook\\\\FileHooks\\:\\:cron\\(\\) has no return type specified\\.$#',
	'count' => 1,
	'path' => __DIR__ . '/modules/file/src/Hook/FileHooks.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\file\\\\Hook\\\\FileHooks\\:\\:fileDownload\\(\\) has no return type specified\\.$#',
@@ -21082,12 +21052,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/history/src/Controller/HistoryController.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\history\\\\Hook\\\\HistoryHooks\\:\\:cron\\(\\) has no return type specified\\.$#',
	'count' => 1,
	'path' => __DIR__ . '/modules/history/src/Hook/HistoryHooks.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\history\\\\Hook\\\\HistoryHooks\\:\\:help\\(\\) has no return type specified\\.$#',
@@ -24118,12 +24082,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/layout_builder/src/Hook/LayoutBuilderHooks.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\layout_builder\\\\Hook\\\\LayoutBuilderHooks\\:\\:cron\\(\\) has no return type specified\\.$#',
	'count' => 1,
	'path' => __DIR__ . '/modules/layout_builder/src/Hook/LayoutBuilderHooks.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\layout_builder\\\\Hook\\\\LayoutBuilderHooks\\:\\:entityDelete\\(\\) has no return type specified\\.$#',
@@ -25564,12 +25522,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/locale/src/Hook/LocaleHooks.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\locale\\\\Hook\\\\LocaleHooks\\:\\:cron\\(\\) has no return type specified\\.$#',
	'count' => 1,
	'path' => __DIR__ . '/modules/locale/src/Hook/LocaleHooks.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\locale\\\\Hook\\\\LocaleHooks\\:\\:help\\(\\) has no return type specified\\.$#',
@@ -30516,12 +30468,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/node/src/Hook/NodeHooks1.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\node\\\\Hook\\\\NodeHooks1\\:\\:cron\\(\\) has no return type specified\\.$#',
	'count' => 1,
	'path' => __DIR__ . '/modules/node/src/Hook/NodeHooks1.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\node\\\\Hook\\\\NodeHooks1\\:\\:entityExtraFieldInfo\\(\\) has no return type specified\\.$#',
@@ -33528,12 +33474,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/search/src/Hook/SearchHooks.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\search\\\\Hook\\\\SearchHooks\\:\\:cron\\(\\) has no return type specified\\.$#',
	'count' => 1,
	'path' => __DIR__ . '/modules/search/src/Hook/SearchHooks.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\search\\\\Hook\\\\SearchHooks\\:\\:help\\(\\) has no return type specified\\.$#',
@@ -35412,12 +35352,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/system/src/Form/ThemeSettingsForm.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\system\\\\Hook\\\\SystemHooks\\:\\:cron\\(\\) has no return type specified\\.$#',
	'count' => 1,
	'path' => __DIR__ . '/modules/system/src/Hook/SystemHooks.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\system\\\\Hook\\\\SystemHooks\\:\\:entityTypeBuild\\(\\) has no return type specified\\.$#',
@@ -36384,12 +36318,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/system/tests/modules/common_test/src/Hook/CommonTestHooks.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\common_test\\\\Hook\\\\CommonTestHooks\\:\\:cron\\(\\) has no return type specified\\.$#',
	'count' => 1,
	'path' => __DIR__ . '/modules/system/tests/modules/common_test/src/Hook/CommonTestHooks.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\common_test\\\\Hook\\\\CommonTestHooks\\:\\:libraryInfoBuild\\(\\) has no return type specified\\.$#',
@@ -36402,12 +36330,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/system/tests/modules/common_test/src/Hook/CommonTestHooks.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\common_test_cron_helper\\\\Hook\\\\CommonTestCronHelperHooks\\:\\:cron\\(\\) has no return type specified\\.$#',
	'count' => 1,
	'path' => __DIR__ . '/modules/system/tests/modules/common_test_cron_helper/src/Hook/CommonTestCronHelperHooks.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\condition_test\\\\FormController\\:\\:submitForm\\(\\) has no return type specified\\.$#',
@@ -43509,12 +43431,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/update/src/Form/UpdateReady.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\update\\\\Hook\\\\UpdateHooks\\:\\:cron\\(\\) has no return type specified\\.$#',
	'count' => 1,
	'path' => __DIR__ . '/modules/update/src/Hook/UpdateHooks.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\update\\\\Hook\\\\UpdateHooks\\:\\:help\\(\\) has no return type specified\\.$#',
@@ -55095,12 +55011,6 @@
	'count' => 1,
	'path' => __DIR__ . '/modules/workspaces/src/FormOperations.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\workspaces\\\\Hook\\\\WorkspacesHooks\\:\\:cron\\(\\) has no return type specified\\.$#',
	'count' => 1,
	'path' => __DIR__ . '/modules/workspaces/src/Hook/WorkspacesHooks.php',
];
$ignoreErrors[] = [
	// identifier: missingType.return
	'message' => '#^Method Drupal\\\\workspaces\\\\Hook\\\\WorkspacesHooks\\:\\:entityAccess\\(\\) has no return type specified\\.$#',
+1 −1
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ public function theme($existing, $type, $theme, $path) : array {
   * Implements hook_cron().
   */
  #[Hook('cron')]
  public function cron() {
  public function cron(): void {
    $config = \Drupal::config('announcements_feed.settings');
    $interval = $config->get('cron_interval');
    $last_check = \Drupal::state()->get('announcements_feed.last_fetch', 0);
+1 −1
Original line number Diff line number Diff line
@@ -382,7 +382,7 @@ public function nodeUpdateIndex(EntityInterface $node) {
   * Implements hook_cron().
   */
  #[Hook('cron')]
  public function cron() {
  public function cron(): void {
    // Store the maximum possible comments per thread (used for node search
    // ranking by reply count).
    \Drupal::state()->set('comment.node_comment_statistics_scale', 1.0 / max(1, \Drupal::service('comment.statistics')->getMaximumCount('node')));
+1 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ public function menuLinksDiscoveredAlter(&$links): void {
   * Controls the size of the log table, paring it to 'dblog_row_limit' messages.
   */
  #[Hook('cron')]
  public function cron() {
  public function cron(): void {
    // Cleanup the watchdog table.
    $row_limit = \Drupal::config('dblog.settings')->get('row_limit');
    // For row limit n, get the wid of the nth row in descending wid order.
+1 −1
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ public function help($route_name, RouteMatchInterface $route_match) {
   * Implements hook_cron().
   */
  #[Hook('cron')]
  public function cron() {
  public function cron(): void {
    // Do a pass of purging on deleted Field API data, if any exists.
    $limit = \Drupal::config('field.settings')->get('purge_batch_size');
    field_purge_batch($limit);
Loading