Skip to content

Commit 1a0286e

Browse files
authored
Merge pull request #12 from kinimodmeyer/php82
Adding php 8.2&8.3 support
2 parents abed95d + 80691a1 commit 1a0286e

8 files changed

Lines changed: 11 additions & 11 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: ubuntu-latest
77
strategy:
88
matrix:
9-
php-versions: ['7.4.*', '8.0.*', '8.1.*']
9+
php-versions: ['7.4.*', '8.0.*', '8.1.*', '8.2.*', '8.3.*']
1010
steps:
1111
- uses: actions/checkout@v2
1212
- name: Setup PHP

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"squizlabs/php_codesniffer": "3.*"
2020
},
2121
"require": {
22-
"php": "7.4.* || 8.0.* || 8.1.*",
22+
"php": "7.4.* || 8.0.* || 8.1.* || 8.2.* || 8.3.*",
2323
"ext-xmlreader": "*",
2424
"ext-simplexml": "*",
2525
"ext-xmlwriter": "*",

src/Message/Handler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function downloadMessage(string $filePath, int $messageId): bool
4747
&& $reader->depth === 1
4848
&& $reader->name == 'MESSAGE'
4949
) {
50-
$filePut = file_put_contents($filePath, $reader->readOuterXml());
50+
$filePut = (bool)file_put_contents($filePath, $reader->readOuterXml());
5151
$reader->close();
5252
return $filePut;
5353
}

src/Order/Handler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct(Client $client)
2222
$this->client = $client;
2323
}
2424

25-
public function getOrder(int $orderId): Order
25+
public function getOrder(int $orderId): ?Order
2626
{
2727
$catalog = new Tborderlist($this->client, 'orders/' . (int)$orderId, []);
2828
$orderIterator = $catalog->getOrders();
@@ -42,15 +42,15 @@ public function getOrderFromFile(string $filePath): Order
4242

4343
public function downloadOrder(string $filePath, int $orderId): bool
4444
{
45-
$reader = $this->client->getRestClient()->getXML('orders/' . (int)$orderId, []);
45+
$reader = $this->client->getRestClient()->getXML('orders/' . $orderId);
4646

4747
while ($reader->read()) {
4848
if (
4949
$reader->nodeType == XMLReader::ELEMENT
5050
&& $reader->depth === 1
5151
&& $reader->name == 'ORDER'
5252
) {
53-
$filePut = file_put_contents($filePath, $reader->readOuterXml());
53+
$filePut = (bool)file_put_contents($filePath, $reader->readOuterXml());
5454
$reader->close();
5555
return $filePut;
5656
}

src/Order/Tborder/Iterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Iterator extends Base\Iterator implements \Iterator
1313
{
1414
private ?Order $current = null;
1515

16-
public function current(): Order
16+
public function current(): ?Order
1717
{
1818
return $this->current;
1919
}

src/Product/Handler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function __construct(Client $client)
2121
$this->client = $client;
2222
}
2323

24-
public function getProduct(int $productId, int $channelId): Product
24+
public function getProduct(int $productId, int $channelId): ?Product
2525
{
2626
$catalog = new Tbcat($this->client, 'products/', ['p_id' => $productId, 'channel' => $channelId]);
2727
$productIterator = $catalog->getProducts();
@@ -52,7 +52,7 @@ public function downloadProduct(string $filePath, int $productId, int $channelId
5252
&& $reader->depth === 2
5353
&& $reader->name == 'PRODUCT'
5454
) {
55-
$filePut = file_put_contents($filePath, $reader->readOuterXml());
55+
$filePut = (bool)file_put_contents($filePath, $reader->readOuterXml());
5656
$reader->close();
5757
return $filePut;
5858
}

src/Product/Tbcat/Iterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function getSupplierName(): ?string
2424
return $this->supplierName;
2525
}
2626

27-
public function current(): Product
27+
public function current(): ?Product
2828
{
2929
return $this->current;
3030
}

src/Stock/Tbstock/Iterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function getChangeDate(): ?string
2323
return $this->changeDate;
2424
}
2525

26-
public function current(): Stock
26+
public function current(): ?Stock
2727
{
2828
return $this->current;
2929
}

0 commit comments

Comments
 (0)