Laravel-ide-helper: [BUG] [ENHANCEMENT] Use `final class`

Created on 20 Feb 2019  路  5Comments  路  Source: barryvdh/laravel-ide-helper

When using a final statement in a class, the IDE helper will paste it's class DocBlock after the final keyword, breaking the code.

I'm assuming that the IDE helper is looking for the class keyword, putting that on a new line and then pasting the DocBlock's contents on the previous line.

If that's the case, again I'm assuming, could we opt to include the final keyword?

Thank you for your time,

Tom de Wit

PS kind regards to the entire office!

Code example:

final /**
 * Domain\Product\Models\Product
 *
 * @property int $id
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\Domain\Product\Models\Product newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\Domain\Product\Models\Product newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\Domain\Product\Models\Product query()
 * @method static \Illuminate\Database\Eloquent\Builder|\Domain\Product\Models\Product whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\Domain\Product\Models\Product whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\Domain\Product\Models\Product whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class Product extends Model
{
}

Desired output:

/**
 * Domain\Product\Models\Product
 *
 * @property int $id
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\Domain\Product\Models\Product newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\Domain\Product\Models\Product newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\Domain\Product\Models\Product query()
 * @method static \Illuminate\Database\Eloquent\Builder|\Domain\Product\Models\Product whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\Domain\Product\Models\Product whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\Domain\Product\Models\Product whereUpdatedAt($value)
 * @mixin \Eloquent
 */
final class Product extends Model
{
}

Most helpful comment

Hey all,
I can second this issue and that it still exists.
I will check if I can provide a fix PR.

All 5 comments

Hey all,
I can second this issue and that it still exists.
I will check if I can provide a fix PR.

It is still not working properly

@rela589n what's your exactly issue?
Which command and what's the in- and output?

Screenshot from 2020-06-26 12-21-18
Screenshot from 2020-06-26 12-24-08
Screenshot from 2020-06-26 12-24-11

@rela589n @Gummibeer Please note there hasn't been a new release since April 22nd. You're probably on 2.7. We'll need to wait for a new release to be tagged including the latest changes on master.

Was this page helpful?
0 / 5 - 0 ratings