File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -40,11 +40,9 @@ public function store(string $path, $content): string
40
40
{
41
41
$ content = $ this ->sort ($ content );
42
42
43
- if ($ this ->hasValidation ($ path )) {
44
- $ content = $ this ->expandValidation ($ content );
45
- } else {
46
- $ content = $ this ->expand ($ content );
47
- }
43
+ $ content = $ this ->hasValidation ($ path )
44
+ ? $ this ->expandValidation ($ content )
45
+ : $ this ->expand ($ content );
48
46
49
47
$ content = $ this ->format ($ content );
50
48
@@ -71,21 +69,20 @@ protected function expand(array $values): array
71
69
72
70
protected function expandValidation (array $ values ): array
73
71
{
74
- // attributes array is stored with flattened keys
75
- // other items are fully expanded
76
72
$ attributes = [];
77
73
$ items = [];
74
+
78
75
foreach ($ values as $ key => $ value ) {
79
76
if (Str::startsWith ($ key , "attributes. " )) {
80
77
$ attributeKey = explode ('. ' , $ key , 2 )[1 ];
81
78
$ attributes [$ attributeKey ] = $ value ;
79
+
82
80
continue ;
83
81
}
84
82
85
83
IlluminateArr::set ($ items , $ key , $ value );
86
84
}
87
85
88
- // capture custom values -> if empty this key will be removed from the result
89
86
$ custom = Arr::get ($ items , 'custom ' );
90
87
91
88
return Arr::of ($ items )
You can’t perform that action at this time.
0 commit comments