mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-19 02:23:11 +00:00
Allow casts with a return type of static or this to reference themselves (#1103)
* Allow casts with a return type of static or this to reference themselves
Supports
```php
/**
* @param $model
* @param string $key
* @param $value
* @param array $attributes
* @return static
*/
public function get($model, string $key, $value, array $attributes)
{
return new static($value);
}
```
or
```php
/**
* @param $model
* @param string $key
* @param $value
* @param array $attributes
* @return $this
*/
public function get($model, string $key, $value, array $attributes)
{
return new static($value);
}
```
* Update CHANGELOG.md
This commit is contained in:
@@ -19,6 +19,11 @@ class CustomCastsTable extends Migration
|
||||
$table->string('casted_property_with_return_nullable_primitive');
|
||||
$table->string('casted_property_without_return');
|
||||
$table->string('casted_property_with_param');
|
||||
$table->string('casted_property_with_static_return_docblock');
|
||||
$table->string('casted_property_with_this_return_docblock');
|
||||
$table->string('extended_casted_property_with_static_return_docblock');
|
||||
$table->string('extended_casted_property_with_this_return_docblock');
|
||||
$table->string('casted_property_with_static_return_docblock_and_param');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user