Altering deeply nested request data #18
Answered
by
lukeraymonddowning
maartenpaauw
asked this question in
Q&A
-
When altering deeply nested request data with the Code example: $requestFactory = new class extends RequestFactory {
public function definition(): array
{
return [
'foo' => 'bar',
'nested' => [
'fizz' => 'buzz',
'buzz' => 'fizz',
],
];
}
};
// ...
$requestFactory::new()
->state(['nested.fizz' => 'fizz'])
->create();
// Results in:
$result = [
"foo" => "bar",
"nested" => [
"fizz" => "fizz",
],
];
// I expected:
$expected = [
"foo" => "bar",
"nested" => [
"fizz" => "fizz",
'buzz' => 'fizz',
],
]; |
Beta Was this translation helpful? Give feedback.
Answered by
lukeraymonddowning
Jul 25, 2022
Replies: 1 comment
-
Your observations are indeed correct. Thanks for the PR. Merged and released 👌 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
lukeraymonddowning
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your observations are indeed correct. Thanks for the PR. Merged and released 👌