mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
* Add `AllowDynamicProperties` Attribute to cooperate with php8.2 deprecation
* lint snapshot
* Fix collection attribute typing
* Update CHANGELOG.md
* Update CHANGELOG.md
* Update CHANGELOG.md
* Update composer.json
* Fix collectino with template types WIP
* Add `AllowDynamicProperties` Attribute to cooperate with php8.2 deprecation
* Fix collection attribute typing
* Update CHANGELOG.md
* Update CHANGELOG.md
* Update composer.json
* composer fix-style
* Fix tests
* Fix tests
* composer fix-style
* Fix collectino with complex template types{
* Delete phpactor
* Install from scrumble repo
* Implemented correct attribute handling
* composer fix-style
* Revert "Install from scrumble repo"
This reverts commit 3f1057adb6.
* Re-add barryvdh links
* Revert "Update composer.json"
This reverts commit 98252fe740.
* Fix pivot test
* Correct CHANGELOG.md with attribute merge request
* More clear PhpDocTypeParser filename and clarified directory according to PSR12
---------
Co-authored-by: GeoSot <[email protected]>
Co-authored-by: laravel-ide-helper <[email protected]>
Co-authored-by: Luukdewaaier <[email protected]>
Co-authored-by: Luuk de Weijer <[email protected]>
60 lines
1.3 KiB
PHP
60 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Attributes\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Casts\Attribute;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class BackedAttribute extends Model
|
|
{
|
|
protected function name(): Attribute
|
|
{
|
|
return new Attribute(
|
|
function (?string $name): ?string {
|
|
return $name;
|
|
},
|
|
function (?string $name): ?string {
|
|
return $name;
|
|
}
|
|
);
|
|
}
|
|
|
|
protected function nameRead(): Attribute
|
|
{
|
|
return new Attribute(
|
|
function (?string $name): ?string {
|
|
return $name;
|
|
},
|
|
);
|
|
}
|
|
|
|
protected function nameWrite(): Attribute
|
|
{
|
|
return new Attribute(
|
|
set: function (?string $name): ?string {
|
|
return $name;
|
|
},
|
|
);
|
|
}
|
|
|
|
protected function nonBackedSet(): Attribute
|
|
{
|
|
return new Attribute(
|
|
set: function (?string $name): ?string {
|
|
return $name;
|
|
},
|
|
);
|
|
}
|
|
|
|
protected function nonBackedGet(): Attribute
|
|
{
|
|
return new Attribute(
|
|
get: function (): ?string {
|
|
return 'test';
|
|
},
|
|
);
|
|
}
|
|
}
|