Skip to content

Commit 1c5b2d1

Browse files
committed
Declare nullable params explicitly null.
1 parent 6fd4457 commit 1c5b2d1

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/Factory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Factory
6363
* @return T
6464
* @throws ClassDoesNotExistsException
6565
*/
66-
public static function create($class, Authentication $authentication = null)
66+
public static function create($class, ?Authentication $authentication = null)
6767
{
6868
if (class_exists($class)) {
6969
return new $class($authentication);

src/Request/Customer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ class Customer extends AbstractSerializer
267267
*
268268
* @param Address|null $billingAddress Billing address
269269
*/
270-
public function __construct(Address $billingAddress = null)
270+
public function __construct(?Address $billingAddress = null)
271271
{
272272
$this->billing = $billingAddress;
273273
}

src/Response/AbstractResponse.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ abstract class AbstractResponse
4949
* @return void
5050
* @throws \InvalidArgumentException
5151
*/
52-
public function headerSetter(\SimpleXMLElement $xml = null)
52+
public function headerSetter(?\SimpleXMLElement $xml = null)
5353
{
5454
if ($xml) {
5555
$this->Header = ResponseSerializer::serialize(Header::class, $xml);
@@ -64,7 +64,7 @@ public function headerSetter(\SimpleXMLElement $xml = null)
6464
* @return static
6565
* @throws \InvalidArgumentException
6666
*/
67-
public function deserialize(\SimpleXMLElement $xml = null)
67+
public function deserialize(?\SimpleXMLElement $xml = null)
6868
{
6969
$object = clone $this;
7070

src/Serializer/ResponseSerializer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ResponseSerializer
4545
public static function serialize(
4646
$objectName,
4747
\SimpleXMLElement $data,
48-
\SimpleXMLElement $header = null
48+
?\SimpleXMLElement $header = null
4949
) {
5050
$object = new $objectName();
5151
$object->headerSetter($header);

0 commit comments

Comments
 (0)