Skip to content

Commit d3b3fb4

Browse files
dmnlkasadali214
andcommitted
feat: adds support for php 8.3 and 8.4 (#62)
This commit adds support for PHP 8.3 in CI/CD pipeline and PHP 8.4 support in all areas Co-authored-by: Asad Ali <asad.ali@apimatic.io> Signed-off-by: Asad Ali <asad.ali@apimatic.io>
1 parent 2274f10 commit d3b3fb4

9 files changed

Lines changed: 29 additions & 22 deletions

File tree

.github/workflows/test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
matrix:
1919
os: [ubuntu-latest] # windows-latest, macos-latest
20-
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
20+
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
2121
include:
2222
- php: 7.2
2323
phpunit: 7
@@ -31,6 +31,10 @@ jobs:
3131
phpunit: 9
3232
- php: 8.2
3333
phpunit: 9
34+
- php: 8.3
35+
phpunit: 9
36+
- php: 8.4
37+
phpunit: 9
3438
steps:
3539
- name: Checkout
3640
uses: actions/checkout@v3

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Core logic and the utilities for the Apimatic's PHP SDK.
1717
- PHP 8.0
1818
- PHP 8.1
1919
- PHP 8.2
20+
- PHP 8.3
21+
- PHP 8.4
2022

2123
## Install the Package
2224

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"require-dev": {
2525
"squizlabs/php_codesniffer": "^3.5",
26-
"phan/phan": "5.4.2",
26+
"phan/phan": "5.4.5",
2727
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5"
2828
},
2929
"autoload": {

composer.lock

Lines changed: 13 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ class Client
2222
{
2323
private static $converter;
2424
private static $jsonHelper;
25-
public static function getConverter(Client $client = null): ConverterInterface
25+
public static function getConverter(?Client $client = null): ConverterInterface
2626
{
2727
if (isset($client)) {
2828
return $client->localConverter;
2929
}
3030
return self::$converter;
3131
}
32-
public static function getJsonHelper(Client $client = null): JsonHelper
32+
public static function getJsonHelper(?Client $client = null): JsonHelper
3333
{
3434
if (isset($client)) {
3535
return $client->localJsonHelper;

src/Types/Sdk/CoreCallback.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class CoreCallback
2727
* @param callable|null $onBeforeRequest Called before an API call
2828
* @param callable|null $onAfterRequest Called after an API call
2929
*/
30-
public function __construct(callable $onBeforeRequest = null, callable $onAfterRequest = null)
30+
public function __construct(?callable $onBeforeRequest = null, ?callable $onAfterRequest = null)
3131
{
3232
$this->onBeforeRequest = $onBeforeRequest;
3333
$this->onAfterRequest = $onAfterRequest;

src/Utils/XmlDeserializer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class XmlDeserializer
2222
/**
2323
* @param int|null $loadOptions A bit field of LIBXML_* constants
2424
*/
25-
public function __construct(int $loadOptions = null)
25+
public function __construct(?int $loadOptions = null)
2626
{
2727
$this->dom = new DOMDocument();
2828
$this->loadOptions = $loadOptions ?? (LIBXML_NONET | LIBXML_NOBLANKS);
@@ -81,7 +81,7 @@ public function fromElementToArray(
8181
\DOMNode $parent,
8282
string $itemName,
8383
string $clazz,
84-
string $wrappingElementName = null
84+
?string $wrappingElementName = null
8585
) {
8686
if ($wrappingElementName === null) {
8787
$elements = static::getChildNodesByTagName($parent, $itemName);

src/Utils/XmlSerializer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function addArrayAsSubelement(
6767
\DOMNode $root,
6868
string $itemName,
6969
$items,
70-
string $wrappingElementName = null
70+
?string $wrappingElementName = null
7171
): void {
7272
if ($items === null) {
7373
return;
@@ -102,7 +102,7 @@ public function addAsSubelement(\DOMNode $root, string $name, $value): ?\DOMElem
102102
return $element;
103103
}
104104

105-
public function createElement(string $name, string $value = null): \DOMElement
105+
public function createElement(string $name, ?string $value = null): \DOMElement
106106
{
107107
return $value === null ? $this->dom->createElement($name) : $this->dom->createElement($name, $value);
108108
}

tests/LoggerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function testConsoleLoggerFailure()
8181

8282
private function logAndGetEntry(
8383
string $level,
84-
LoggerInterface $logger = null,
84+
?LoggerInterface $logger = null,
8585
string $message = 'someMessage',
8686
array $context = []
8787
): LogEntry {

0 commit comments

Comments
 (0)