@@ -39,7 +39,7 @@ public static function getSubscribingMethods(): array
39
39
return JMSFormErrorHandler::getSubscribingMethods ();
40
40
}
41
41
42
- public function serializeFormToXml (XmlSerializationVisitor $ visitor , Form $ form , array $ type , Context $ context = null )
42
+ public function serializeFormToXml (XmlSerializationVisitor $ visitor , Form $ form , array $ type , ? Context $ context = null )
43
43
{
44
44
if ($ context ) {
45
45
if ($ context ->hasAttribute ('status_code ' )) {
@@ -72,7 +72,7 @@ public function serializeFormToXml(XmlSerializationVisitor $visitor, Form $form,
72
72
return $ this ->formErrorHandler ->serializeFormToXml ($ visitor , $ form , $ type );
73
73
}
74
74
75
- public function serializeFormToJson (JsonSerializationVisitor $ visitor , Form $ form , array $ type , Context $ context = null )
75
+ public function serializeFormToJson (JsonSerializationVisitor $ visitor , Form $ form , array $ type , ? Context $ context = null )
76
76
{
77
77
$ isRoot = !interface_exists (SerializationVisitorInterface::class) && null === $ visitor ->getRoot ();
78
78
$ result = $ this ->adaptFormArray ($ this ->formErrorHandler ->serializeFormToJson ($ visitor , $ form , $ type ), $ context );
@@ -84,7 +84,7 @@ public function serializeFormToJson(JsonSerializationVisitor $visitor, Form $for
84
84
return $ result ;
85
85
}
86
86
87
- public function serializeFormToYml (YamlSerializationVisitor $ visitor , Form $ form , array $ type , Context $ context = null )
87
+ public function serializeFormToYml (YamlSerializationVisitor $ visitor , Form $ form , array $ type , ? Context $ context = null )
88
88
{
89
89
$ isRoot = null === $ visitor ->getRoot ();
90
90
$ result = $ this ->adaptFormArray ($ this ->formErrorHandler ->serializeFormToYml ($ visitor , $ form , $ type ), $ context );
@@ -101,7 +101,7 @@ public function __call($name, $arguments)
101
101
return call_user_func_array ([$ this ->formErrorHandler , $ name ], $ arguments );
102
102
}
103
103
104
- private function adaptFormArray (\ArrayObject $ serializedForm , Context $ context = null )
104
+ private function adaptFormArray (\ArrayObject $ serializedForm , ? Context $ context = null )
105
105
{
106
106
$ statusCode = $ this ->getStatusCode ($ context );
107
107
if (null !== $ statusCode ) {
@@ -115,7 +115,7 @@ private function adaptFormArray(\ArrayObject $serializedForm, Context $context =
115
115
return $ serializedForm ;
116
116
}
117
117
118
- private function getStatusCode (Context $ context = null )
118
+ private function getStatusCode (? Context $ context = null )
119
119
{
120
120
if (null === $ context ) {
121
121
return ;
0 commit comments