Consider disabling the Drupal.Commenting.FunctionComment.VoidReturn rule

Created on 13 May 2023, over 1 year ago

Problem/Motivation

Split from 📌 Update to Symfony 6.3 Fixed .
We're having to add @return void to avoid deprecation messages from Symfony, but that conflicts with Drupal.Commenting.FunctionComment.VoidReturn

If there is no return value for a function, there must not be a @return tag

   /**
    * {@inheritdoc}
+   *
+   * phpcs:ignore Drupal.Commenting.FunctionComment.VoidReturn
+   * @return void
    */
   public function validate($value, Constraint $constraint) {
     if (!$constraint instanceof Range) {

Should we just skip this rule, or change it to explicitly allow @return void?

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component
Base 

Last updated about 2 hours ago

Created by

🇬🇧United Kingdom catch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @catch
  • 🇮🇹Italy mondrake 🇮🇹

    My 2 cents: allow explicitly @return void as a proxy for a future native typehinting of the method, which would lead to a TypeError in case a return is present and anything is returned. PHPStan will also use that to do the same check IIRC, which is also prep for later typehinting.

Production build 0.71.5 2024