mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-19 18:43:12 +00:00
Allow casts without property (#1267)
* Allow casts without property * Update changelog
This commit is contained in:
@@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
- Add support of variadic parameters in `ide-helper:models` [\#1234 / shaffe-fr](https://github.com/barryvdh/laravel-ide-helper/pull/1234)
|
- Add support of variadic parameters in `ide-helper:models` [\#1234 / shaffe-fr](https://github.com/barryvdh/laravel-ide-helper/pull/1234)
|
||||||
|
- Add support of custom casts without properties [\#1267 / sparclex](https://github.com/barryvdh/laravel-ide-helper/pull/1267)
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Move default models helper filename to config [\#1241 / wimski](https://github.com/barryvdh/laravel-ide-helper/pull/1241)
|
- Move default models helper filename to config [\#1241 / wimski](https://github.com/barryvdh/laravel-ide-helper/pull/1241)
|
||||||
|
|||||||
@@ -392,6 +392,7 @@ class ModelsCommand extends Command
|
|||||||
// the `$type` until the `:`
|
// the `$type` until the `:`
|
||||||
$type = strtok($type, ':');
|
$type = strtok($type, ':');
|
||||||
$realType = class_exists($type) ? ('\\' . $type) : 'mixed';
|
$realType = class_exists($type) ? ('\\' . $type) : 'mixed';
|
||||||
|
$this->setProperty($name, null, true, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,5 +34,6 @@ class CustomCast extends Model
|
|||||||
'extended_casted_property_with_static_return_docblock' => ExtendedSelfCastingCasterWithStaticDocblockReturn::class,
|
'extended_casted_property_with_static_return_docblock' => ExtendedSelfCastingCasterWithStaticDocblockReturn::class,
|
||||||
'extended_casted_property_with_this_return_docblock' => ExtendedSelfCastingCasterWithThisDocblockReturn::class,
|
'extended_casted_property_with_this_return_docblock' => ExtendedSelfCastingCasterWithThisDocblockReturn::class,
|
||||||
'casted_property_with_static_return_docblock_and_param' => SelfCastingCasterWithStaticDocblockReturn::class . ':param',
|
'casted_property_with_static_return_docblock_and_param' => SelfCastingCasterWithStaticDocblockReturn::class . ':param',
|
||||||
|
'cast_without_property' => CustomCasterWithReturnType::class,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
* @property ExtendedSelfCastingCasterWithStaticDocblockReturn $extended_casted_property_with_static_return_docblock
|
* @property ExtendedSelfCastingCasterWithStaticDocblockReturn $extended_casted_property_with_static_return_docblock
|
||||||
* @property ExtendedSelfCastingCasterWithThisDocblockReturn $extended_casted_property_with_this_return_docblock
|
* @property ExtendedSelfCastingCasterWithThisDocblockReturn $extended_casted_property_with_this_return_docblock
|
||||||
* @property SelfCastingCasterWithStaticDocblockReturn $casted_property_with_static_return_docblock_and_param
|
* @property SelfCastingCasterWithStaticDocblockReturn $casted_property_with_static_return_docblock_and_param
|
||||||
|
* @property \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\LaravelCustomCasts\Casts\CastedProperty $cast_without_property
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CustomCast newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder|CustomCast newModelQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CustomCast newQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder|CustomCast newQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|CustomCast query()
|
* @method static \Illuminate\Database\Eloquent\Builder|CustomCast query()
|
||||||
@@ -68,5 +69,6 @@ class CustomCast extends Model
|
|||||||
'extended_casted_property_with_static_return_docblock' => ExtendedSelfCastingCasterWithStaticDocblockReturn::class,
|
'extended_casted_property_with_static_return_docblock' => ExtendedSelfCastingCasterWithStaticDocblockReturn::class,
|
||||||
'extended_casted_property_with_this_return_docblock' => ExtendedSelfCastingCasterWithThisDocblockReturn::class,
|
'extended_casted_property_with_this_return_docblock' => ExtendedSelfCastingCasterWithThisDocblockReturn::class,
|
||||||
'casted_property_with_static_return_docblock_and_param' => SelfCastingCasterWithStaticDocblockReturn::class . ':param',
|
'casted_property_with_static_return_docblock_and_param' => SelfCastingCasterWithStaticDocblockReturn::class . ':param',
|
||||||
|
'cast_without_property' => CustomCasterWithReturnType::class,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user