Skip to content

Commit 8fac918

Browse files
Update Php.php
1 parent c6d5a4e commit 8fac918

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/Services/Filesystem/Php.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ public function store(string $path, $content): string
4040
{
4141
$content = $this->sort($content);
4242

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);
4846

4947
$content = $this->format($content);
5048

@@ -71,21 +69,20 @@ protected function expand(array $values): array
7169

7270
protected function expandValidation(array $values): array
7371
{
74-
// attributes array is stored with flattened keys
75-
// other items are fully expanded
7672
$attributes = [];
7773
$items = [];
74+
7875
foreach ($values as $key => $value) {
7976
if (Str::startsWith($key, "attributes.")) {
8077
$attributeKey = explode('.', $key, 2)[1];
8178
$attributes[$attributeKey] = $value;
79+
8280
continue;
8381
}
8482

8583
IlluminateArr::set($items, $key, $value);
8684
}
8785

88-
// capture custom values -> if empty this key will be removed from the result
8986
$custom = Arr::get($items, 'custom');
9087

9188
return Arr::of($items)

0 commit comments

Comments
 (0)