Skip to content

Commit

Permalink
codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
Maz committed Oct 7, 2024
1 parent d4c93db commit 6d7ebf5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/MultipartStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,12 @@ private function addElement(AppendStream $stream, array $element): void
}

if (is_array($element['contents'])) {
$prepare = function ($contents, $key, $root = null) use ($stream, &$prepare) {
$prepare = function ($contents, $key, $root = null) use ($stream, &$prepare): void {
$fieldName = $root ? sprintf('%s[%s]', $root, $key) : $key;

if (is_array($contents)) {
array_walk($contents, $prepare, $fieldName);

return;
}

Expand Down
6 changes: 3 additions & 3 deletions tests/MultipartStreamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ public function testExpandNestedArrayFields(): void
'name' => 'foo',
'contents' => [
['key' => 'bar'],
['key' => 'baz']
]
]
['key' => 'baz'],
],
],
], 'boundary');

$expected = \implode('', [
Expand Down

0 comments on commit 6d7ebf5

Please sign in to comment.