laravel-ide-helper icon indicating copy to clipboard operation
laravel-ide-helper copied to clipboard

Add support for attribute accessors without return type declared in closures

Open EmanueleCoppola opened this issue 1 year ago • 1 comments

Summary

Enable the recognition of attributes without any return type in the declared closures.

The following example was not recognized before:

protected function attributeWithoutReturnTypes(): Attribute
{
    return new Attribute(
        function (?string $name) {
            return $name;
        },
        function (?string $name) {
            return $name === null ? null : ucfirst($name);
        }
    );
}

Now the aforementioned method should produce the following declaration:

 * @property mixed $attribute_without_return_types

Type of change

  • [x] New feature (non-breaking change which adds functionality)

Checklist

  • [x] Existing tests have been adapted and/or new tests have been added
  • [x] Add a CHANGELOG.md entry
  • [ ] Update the README.md
  • [x] Code style has been fixed via composer fix-style

EmanueleCoppola avatar May 18 '23 21:05 EmanueleCoppola

Is this fixed with https://github.com/barryvdh/laravel-ide-helper/pull/1411 ?

barryvdh avatar Feb 08 '24 08:02 barryvdh