File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed
tests/Console/ModelsCommand/Attributes Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,13 @@ function (?string $name): ?string {
21
21
);
22
22
}
23
23
24
+ public function uppercaseName (): Attribute
25
+ {
26
+ return Attribute::get (function (): string {
27
+ return strtoupper ($ this ->name );
28
+ });
29
+ }
30
+
24
31
/**
25
32
* ide-helper does not recognize this method being an Attribute
26
33
* because the method has no actual return type;
@@ -40,4 +47,17 @@ function (?string $value): ?string {
40
47
}
41
48
);
42
49
}
50
+
51
+ /**
52
+ * ide-helper does not recognize this method being an Attribute
53
+ * because the callable has no specified return type;
54
+ *
55
+ * @return \Illuminate\Database\Eloquent\Casts\Attribute
56
+ */
57
+ public function alsoNotAnAttribute (): Attribute
58
+ {
59
+ return Attribute::get (function () {
60
+ return strtoupper ($ this ->name );
61
+ });
62
+ }
43
63
}
Original file line number Diff line number Diff line change 12
12
*
13
13
* @property integer $id
14
14
* @property string|null $name
15
+ * @property-read string $uppercase_name
15
16
* @method static \Illuminate\Database\Eloquent\Builder|Simple newModelQuery()
16
17
* @method static \Illuminate\Database\Eloquent\Builder|Simple newQuery()
17
18
* @method static \Illuminate\Database\Eloquent\Builder|Simple query()
@@ -32,6 +33,13 @@ function (?string $name): ?string {
32
33
);
33
34
}
34
35
36
+ public function uppercaseName (): Attribute
37
+ {
38
+ return Attribute::get (function (): string {
39
+ return strtoupper ($ this ->name );
40
+ });
41
+ }
42
+
35
43
/**
36
44
* ide-helper does not recognize this method being an Attribute
37
45
* because the method has no actual return type;
@@ -51,4 +59,17 @@ function (?string $value): ?string {
51
59
}
52
60
);
53
61
}
62
+
63
+ /**
64
+ * ide-helper does not recognize this method being an Attribute
65
+ * because the callable has no specified return type;
66
+ *
67
+ * @return \Illuminate\Database\Eloquent\Casts\Attribute
68
+ */
69
+ public function alsoNotAnAttribute (): Attribute
70
+ {
71
+ return Attribute::get (function () {
72
+ return strtoupper ($ this ->name );
73
+ });
74
+ }
54
75
}
You can’t perform that action at this time.
0 commit comments