File tree Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Tobyz \JsonApiServer \Schema \Concerns ;
4
+
5
+ trait HasProperty
6
+ {
7
+ public ?string $ property = null ;
8
+
9
+ public function property (?string $ property ): static
10
+ {
11
+ $ this ->property = $ property ;
12
+
13
+ return $ this ;
14
+ }
15
+ }
Original file line number Diff line number Diff line change 3
3
namespace Tobyz \JsonApiServer \Schema \Field ;
4
4
5
5
use Tobyz \JsonApiServer \Schema \Concerns \GetsValue ;
6
+ use Tobyz \JsonApiServer \Schema \Concerns \HasProperty ;
6
7
use Tobyz \JsonApiServer \Schema \Concerns \HasVisibility ;
7
8
use Tobyz \JsonApiServer \Schema \Concerns \SetsValue ;
8
9
9
10
abstract class Field
10
11
{
12
+ use HasProperty;
11
13
use HasVisibility;
12
14
use GetsValue;
13
15
use SetsValue;
14
16
15
- public ?string $ property = null ;
16
17
public bool $ nullable = false ;
17
18
public ?string $ description = null ;
18
19
public array $ schema = [];
@@ -26,13 +27,6 @@ public static function make(string $name): static
26
27
return new static ($ name );
27
28
}
28
29
29
- public function property (?string $ property ): static
30
- {
31
- $ this ->property = $ property ;
32
-
33
- return $ this ;
34
- }
35
-
36
30
public function nullable (bool $ nullable = true ): static
37
31
{
38
32
$ this ->nullable = $ nullable ;
You can’t perform that action at this time.
0 commit comments