Skip to content

Commit 6833de5

Browse files
Update Parameter.php
Set $data to originalData after extend to allow nested models that are extended by other models to pass properties through to parents, per issue 184 (guzzle#184).
1 parent 4989d90 commit 6833de5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Parameter.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,6 @@ class Parameter implements ToArrayInterface
177177
*/
178178
public function __construct(array $data = [], array $options = [])
179179
{
180-
$this->originalData = $data;
181-
182180
if (isset($options['description'])) {
183181
$this->serviceDescription = $options['description'];
184182
if (!($this->serviceDescription instanceof DescriptionInterface)) {
@@ -202,6 +200,9 @@ public function __construct(array $data = [], array $options = [])
202200
}
203201
}
204202

203+
// Set data after extend to allow nested models to pass properties
204+
$this->originalData = $data;
205+
205206
// Pull configuration data into the parameter
206207
foreach ($data as $key => $value) {
207208
$this->{$key} = $value;

0 commit comments

Comments
 (0)