mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-17 17:47:13 +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:
@@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file.
|
||||
- Compatibility with Lumen [\#1043 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/1043)
|
||||
- Allow model_locations to have glob patterns [\#1059 / saackearl](https://github.com/barryvdh/laravel-ide-helper/pull/1059)
|
||||
- Error when generating helper for macroable classes which are not facades and contain a "fake" method [\#1066 / domkrm] (https://github.com/barryvdh/laravel-ide-helper/pull/1066)
|
||||
- Casts with a return type of `static` or `$this` now resolve to an instance of the cast [\#1103 / riesjart](https://github.com/barryvdh/laravel-ide-helper/pull/1103)
|
||||
|
||||
2020-09-07, 2.8.1
|
||||
-----------------
|
||||
|
||||
Reference in New Issue
Block a user