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

New Laravel attributes are not correctly recognized when method is protected

Open bbprojectnet opened this issue 3 years ago • 0 comments

Versions:

  • ide-helper Version: 2.12.3
  • Laravel Version: 9.29.0
  • PHP Version: 8.1

Description:

Only public and type casted get/set methods attributes are detected.

But, according to https://laravel.com/docs/9.x/eloquent-mutators mutator method should be protected.

Also, it would be nice if ide helper supported the generic attribute declaration, like that:

	/**
	 * Name attribute.
	 *
	 * @return \Illuminate\Database\Eloquent\Casts\Attribute<string, never>
	 */
	protected function name(): Attribute
	{
		return Attribute::make(
			get: fn () => 'foo',
		);
	}

if the get/set methods do not have a return type specified.

bbprojectnet avatar Sep 21 '22 09:09 bbprojectnet