Skip to content

Commit

Permalink
fix deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
dmnlk committed Nov 26, 2024
1 parent 6c32d7f commit 922e4b8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Types/Sdk/CoreCallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/Utils/XmlDeserializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/Utils/XmlSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function addArrayAsSubelement(
\DOMNode $root,
string $itemName,
$items,
string $wrappingElementName = null
?string $wrappingElementName = null
): void {
if ($items === null) {
return;
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 922e4b8

Please sign in to comment.