mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 10:07:12 +00:00
Add support for protected Attribute accessors (#1339)
* Add support for protected Attribute accessors * Fix formatting * Prevent accessors methods marked as private from being added * Exclude specific accessors based on trait instead of class * Add changelog entry * Add clarifying comment * Fix accessor attributes not working on PHP < 8.1 * Reintroduce method variable to reduce PR clutter * Change variable name to reduce PR clutter * Update CHANGELOG.md --------- Co-authored-by: Barry vd. Heuvel <[email protected]> Co-authored-by: Barry vd. Heuvel <[email protected]>
This commit is contained in:
co-authored by
Barry vd. Heuvel
Barry vd. Heuvel
parent
aa1aa66ee6
commit
39885645b9
@@ -20,7 +20,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
*/
|
||||
class Simple extends Model
|
||||
{
|
||||
public function name(): Attribute
|
||||
protected function name(): Attribute
|
||||
{
|
||||
return new Attribute(
|
||||
function (?string $name): ?string {
|
||||
@@ -40,7 +40,7 @@ class Simple extends Model
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Casts\Attribute
|
||||
*/
|
||||
public function notAnAttribute()
|
||||
protected function notAnAttribute()
|
||||
{
|
||||
return new Attribute(
|
||||
function (?string $value): ?string {
|
||||
|
||||
Reference in New Issue
Block a user