laravel-ide-helper
laravel-ide-helper copied to clipboard
CastsInboundAttributes generates incorrect property type
Versions:
- ide-helper Version: 2.12.3
- Laravel Version: 9.29.0
- PHP Version: 8.1
Description:
If castable implements CastsInboundAttributes IDE helper generates incorrect PHP doc type, for example:
protected $casts = [
'password' => AsHash::class,
];
class AsHash implements CastsInboundAttributes
{
/**
* @inheritDoc
*/
public function set($model, string $key, $value, array $attributes): ?string
{
if ($value === null) {
return null;
}
return Hash::make($value); // @codeCoverageIgnore
}
}
User.php php doc block:
@property \BBProjectNet\LaravelCasts\AsHash|null $password
If castable implements CastsInboundAttributes type should by inherit from database type.
Seems there's already a PR => https://github.com/barryvdh/laravel-ide-helper/pull/1329
Closing, as PR was merged and released