File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace Knuckles \Camel \Extraction ;
4
4
5
-
6
5
use Knuckles \Camel \BaseDTO ;
7
6
8
7
class Parameter extends BaseDTO
9
8
{
10
9
public string $ name ;
11
- public ? string $ description = null ;
10
+ public string $ description = '' ;
12
11
public bool $ required = false ;
13
12
public mixed $ example = null ;
14
- public string $ type = ' string ' ;
13
+ public ? string $ type = null ;
15
14
public array $ enumValues = [];
15
+ public array $ custom = [];
16
16
public bool $ exampleWasSpecified = false ;
17
17
public bool $ nullable = false ;
18
18
19
- public function __construct ( array $ parameters = [])
19
+ public static function create ( BaseDTO | array $ data , BaseDTO | array $ inheritFrom = []): static
20
20
{
21
- unset($ parameters ['setter ' ]);
22
- parent ::__construct ($ parameters );
21
+ $ dataArray = is_array ($ data ) ? $ data : $ data ->toArray ();
22
+ $ inheritFromArray = is_array ($ inheritFrom ) ? $ inheritFrom : $ inheritFrom ->toArray ();
23
+ $ merged = array_merge ($ inheritFromArray , $ dataArray );
24
+ return new static ($ merged );
23
25
}
24
26
}
You can’t perform that action at this time.
0 commit comments