Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/php84 compatible #62

Merged
merged 5 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest] # windows-latest, macos-latest
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
include:
- php: 7.2
phpunit: 7
Expand All @@ -31,6 +31,10 @@ jobs:
phpunit: 9
- php: 8.2
phpunit: 9
- php: 8.3
phpunit: 9
- php: 8.4
phpunit: 9
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.5",
"phan/phan": "5.4.2",
"phan/phan": "5.4.5",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5"
},
"autoload": {
Expand Down
25 changes: 13 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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
2 changes: 1 addition & 1 deletion tests/LoggerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function testConsoleLoggerFailure()

private function logAndGetEntry(
string $level,
LoggerInterface $logger = null,
?LoggerInterface $logger = null,
string $message = 'someMessage',
array $context = []
): LogEntry {
Expand Down
Loading