diff --git a/src/Client.php b/src/Client.php index 77c8dfe..dfb18ba 100644 --- a/src/Client.php +++ b/src/Client.php @@ -22,14 +22,14 @@ class Client { private static $converter; private static $jsonHelper; - public static function getConverter(Client $client = null): ConverterInterface + public static function getConverter(?Client $client = null): ConverterInterface { if (isset($client)) { return $client->localConverter; } return self::$converter; } - public static function getJsonHelper(Client $client = null): JsonHelper + public static function getJsonHelper(?Client $client = null): JsonHelper { if (isset($client)) { return $client->localJsonHelper; diff --git a/src/Types/Sdk/CoreCallback.php b/src/Types/Sdk/CoreCallback.php index 7731e1a..166dbec 100644 --- a/src/Types/Sdk/CoreCallback.php +++ b/src/Types/Sdk/CoreCallback.php @@ -27,7 +27,7 @@ class CoreCallback * @param callable|null $onBeforeRequest Called before an API call * @param callable|null $onAfterRequest Called after an API call */ - public function __construct(callable $onBeforeRequest = null, callable $onAfterRequest = null) + public function __construct(?callable $onBeforeRequest = null, ?callable $onAfterRequest = null) { $this->onBeforeRequest = $onBeforeRequest; $this->onAfterRequest = $onAfterRequest; diff --git a/src/Utils/XmlDeserializer.php b/src/Utils/XmlDeserializer.php index 1e29f12..c67fc7a 100644 --- a/src/Utils/XmlDeserializer.php +++ b/src/Utils/XmlDeserializer.php @@ -22,7 +22,7 @@ class XmlDeserializer /** * @param int|null $loadOptions A bit field of LIBXML_* constants */ - public function __construct(int $loadOptions = null) + public function __construct(?int $loadOptions = null) { $this->dom = new DOMDocument(); $this->loadOptions = $loadOptions ?? (LIBXML_NONET | LIBXML_NOBLANKS); @@ -81,7 +81,7 @@ public function fromElementToArray( \DOMNode $parent, string $itemName, string $clazz, - string $wrappingElementName = null + ?string $wrappingElementName = null ) { if ($wrappingElementName === null) { $elements = static::getChildNodesByTagName($parent, $itemName); diff --git a/src/Utils/XmlSerializer.php b/src/Utils/XmlSerializer.php index 0162abe..170d936 100644 --- a/src/Utils/XmlSerializer.php +++ b/src/Utils/XmlSerializer.php @@ -67,7 +67,7 @@ public function addArrayAsSubelement( \DOMNode $root, string $itemName, $items, - string $wrappingElementName = null + ?string $wrappingElementName = null ): void { if ($items === null) { return; @@ -102,7 +102,7 @@ public function addAsSubelement(\DOMNode $root, string $name, $value): ?\DOMElem return $element; } - public function createElement(string $name, string $value = null): \DOMElement + public function createElement(string $name, ?string $value = null): \DOMElement { return $value === null ? $this->dom->createElement($name) : $this->dom->createElement($name, $value); }