1010
1111namespace Docker \API \Normalizer ;
1212
13- use Symfony \Component \Serializer \Exception \InvalidArgumentException ;
1413use Symfony \Component \Serializer \Normalizer \DenormalizerAwareInterface ;
1514use Symfony \Component \Serializer \Normalizer \DenormalizerAwareTrait ;
1615use Symfony \Component \Serializer \Normalizer \DenormalizerInterface ;
@@ -36,51 +35,51 @@ public function supportsNormalization($data, $format = null)
3635 public function denormalize ($ data , $ class , $ format = null , array $ context = [])
3736 {
3837 if (!is_object ($ data )) {
39- throw new InvalidArgumentException () ;
38+ return null ;
4039 }
4140 $ object = new \Docker \API \Model \Config ();
42- if (property_exists ($ data , 'Hostname ' )) {
41+ if (property_exists ($ data , 'Hostname ' ) && $ data ->{ ' Hostname ' } !== null ) {
4342 $ object ->setHostname ($ data ->{'Hostname ' });
4443 }
45- if (property_exists ($ data , 'Domainname ' )) {
44+ if (property_exists ($ data , 'Domainname ' ) && $ data ->{ ' Domainname ' } !== null ) {
4645 $ object ->setDomainname ($ data ->{'Domainname ' });
4746 }
48- if (property_exists ($ data , 'User ' )) {
47+ if (property_exists ($ data , 'User ' ) && $ data ->{ ' User ' } !== null ) {
4948 $ object ->setUser ($ data ->{'User ' });
5049 }
51- if (property_exists ($ data , 'AttachStdin ' )) {
50+ if (property_exists ($ data , 'AttachStdin ' ) && $ data ->{ ' AttachStdin ' } !== null ) {
5251 $ object ->setAttachStdin ($ data ->{'AttachStdin ' });
5352 }
54- if (property_exists ($ data , 'AttachStdout ' )) {
53+ if (property_exists ($ data , 'AttachStdout ' ) && $ data ->{ ' AttachStdout ' } !== null ) {
5554 $ object ->setAttachStdout ($ data ->{'AttachStdout ' });
5655 }
57- if (property_exists ($ data , 'AttachStderr ' )) {
56+ if (property_exists ($ data , 'AttachStderr ' ) && $ data ->{ ' AttachStderr ' } !== null ) {
5857 $ object ->setAttachStderr ($ data ->{'AttachStderr ' });
5958 }
60- if (property_exists ($ data , 'ExposedPorts ' )) {
59+ if (property_exists ($ data , 'ExposedPorts ' ) && $ data ->{ ' ExposedPorts ' } !== null ) {
6160 $ values = new \ArrayObject ([], \ArrayObject::ARRAY_AS_PROPS );
6261 foreach ($ data ->{'ExposedPorts ' } as $ key => $ value ) {
6362 $ values [$ key ] = $ value ;
6463 }
6564 $ object ->setExposedPorts ($ values );
6665 }
67- if (property_exists ($ data , 'Tty ' )) {
66+ if (property_exists ($ data , 'Tty ' ) && $ data ->{ ' Tty ' } !== null ) {
6867 $ object ->setTty ($ data ->{'Tty ' });
6968 }
70- if (property_exists ($ data , 'OpenStdin ' )) {
69+ if (property_exists ($ data , 'OpenStdin ' ) && $ data ->{ ' OpenStdin ' } !== null ) {
7170 $ object ->setOpenStdin ($ data ->{'OpenStdin ' });
7271 }
73- if (property_exists ($ data , 'StdinOnce ' )) {
72+ if (property_exists ($ data , 'StdinOnce ' ) && $ data ->{ ' StdinOnce ' } !== null ) {
7473 $ object ->setStdinOnce ($ data ->{'StdinOnce ' });
7574 }
76- if (property_exists ($ data , 'Env ' )) {
75+ if (property_exists ($ data , 'Env ' ) && $ data ->{ ' Env ' } !== null ) {
7776 $ values_1 = [];
7877 foreach ($ data ->{'Env ' } as $ value_1 ) {
7978 $ values_1 [] = $ value_1 ;
8079 }
8180 $ object ->setEnv ($ values_1 );
8281 }
83- if (property_exists ($ data , 'Cmd ' )) {
82+ if (property_exists ($ data , 'Cmd ' ) && $ data ->{ ' Cmd ' } !== null ) {
8483 $ value_2 = $ data ->{'Cmd ' };
8584 if (is_array ($ data ->{'Cmd ' })) {
8685 $ values_2 = [];
@@ -94,22 +93,22 @@ public function denormalize($data, $class, $format = null, array $context = [])
9493 }
9594 $ object ->setCmd ($ value_2 );
9695 }
97- if (property_exists ($ data , 'Healthcheck ' )) {
96+ if (property_exists ($ data , 'Healthcheck ' ) && $ data ->{ ' Healthcheck ' } !== null ) {
9897 $ object ->setHealthcheck ($ this ->denormalizer ->denormalize ($ data ->{'Healthcheck ' }, 'Docker \\API \\Model \\ConfigHealthcheck ' , 'json ' , $ context ));
9998 }
100- if (property_exists ($ data , 'ArgsEscaped ' )) {
99+ if (property_exists ($ data , 'ArgsEscaped ' ) && $ data ->{ ' ArgsEscaped ' } !== null ) {
101100 $ object ->setArgsEscaped ($ data ->{'ArgsEscaped ' });
102101 }
103- if (property_exists ($ data , 'Image ' )) {
102+ if (property_exists ($ data , 'Image ' ) && $ data ->{ ' Image ' } !== null ) {
104103 $ object ->setImage ($ data ->{'Image ' });
105104 }
106- if (property_exists ($ data , 'Volumes ' )) {
105+ if (property_exists ($ data , 'Volumes ' ) && $ data ->{ ' Volumes ' } !== null ) {
107106 $ object ->setVolumes ($ this ->denormalizer ->denormalize ($ data ->{'Volumes ' }, 'Docker \\API \\Model \\ConfigVolumes ' , 'json ' , $ context ));
108107 }
109- if (property_exists ($ data , 'WorkingDir ' )) {
108+ if (property_exists ($ data , 'WorkingDir ' ) && $ data ->{ ' WorkingDir ' } !== null ) {
110109 $ object ->setWorkingDir ($ data ->{'WorkingDir ' });
111110 }
112- if (property_exists ($ data , 'Entrypoint ' )) {
111+ if (property_exists ($ data , 'Entrypoint ' ) && $ data ->{ ' Entrypoint ' } !== null ) {
113112 $ value_4 = $ data ->{'Entrypoint ' };
114113 if (is_array ($ data ->{'Entrypoint ' })) {
115114 $ values_3 = [];
@@ -123,33 +122,33 @@ public function denormalize($data, $class, $format = null, array $context = [])
123122 }
124123 $ object ->setEntrypoint ($ value_4 );
125124 }
126- if (property_exists ($ data , 'NetworkDisabled ' )) {
125+ if (property_exists ($ data , 'NetworkDisabled ' ) && $ data ->{ ' NetworkDisabled ' } !== null ) {
127126 $ object ->setNetworkDisabled ($ data ->{'NetworkDisabled ' });
128127 }
129- if (property_exists ($ data , 'MacAddress ' )) {
128+ if (property_exists ($ data , 'MacAddress ' ) && $ data ->{ ' MacAddress ' } !== null ) {
130129 $ object ->setMacAddress ($ data ->{'MacAddress ' });
131130 }
132- if (property_exists ($ data , 'OnBuild ' )) {
131+ if (property_exists ($ data , 'OnBuild ' ) && $ data ->{ ' OnBuild ' } !== null ) {
133132 $ values_4 = [];
134133 foreach ($ data ->{'OnBuild ' } as $ value_6 ) {
135134 $ values_4 [] = $ value_6 ;
136135 }
137136 $ object ->setOnBuild ($ values_4 );
138137 }
139- if (property_exists ($ data , 'Labels ' )) {
138+ if (property_exists ($ data , 'Labels ' ) && $ data ->{ ' Labels ' } !== null ) {
140139 $ values_5 = new \ArrayObject ([], \ArrayObject::ARRAY_AS_PROPS );
141140 foreach ($ data ->{'Labels ' } as $ key_1 => $ value_7 ) {
142141 $ values_5 [$ key_1 ] = $ value_7 ;
143142 }
144143 $ object ->setLabels ($ values_5 );
145144 }
146- if (property_exists ($ data , 'StopSignal ' )) {
145+ if (property_exists ($ data , 'StopSignal ' ) && $ data ->{ ' StopSignal ' } !== null ) {
147146 $ object ->setStopSignal ($ data ->{'StopSignal ' });
148147 }
149- if (property_exists ($ data , 'StopTimeout ' )) {
148+ if (property_exists ($ data , 'StopTimeout ' ) && $ data ->{ ' StopTimeout ' } !== null ) {
150149 $ object ->setStopTimeout ($ data ->{'StopTimeout ' });
151150 }
152- if (property_exists ($ data , 'Shell ' )) {
151+ if (property_exists ($ data , 'Shell ' ) && $ data ->{ ' Shell ' } !== null ) {
153152 $ values_6 = [];
154153 foreach ($ data ->{'Shell ' } as $ value_8 ) {
155154 $ values_6 [] = $ value_8 ;
0 commit comments