Skip to content

Commit

Permalink
Merge pull request #12 from kinimodmeyer/php82
Browse files Browse the repository at this point in the history
Adding php 8.2&8.3 support
  • Loading branch information
kinimodmeyer authored Mar 22, 2024
2 parents abed95d + 80691a1 commit 1a0286e
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4.*', '8.0.*', '8.1.*']
php-versions: ['7.4.*', '8.0.*', '8.1.*', '8.2.*', '8.3.*']
steps:
- uses: actions/checkout@v2
- name: Setup PHP
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"squizlabs/php_codesniffer": "3.*"
},
"require": {
"php": "7.4.* || 8.0.* || 8.1.*",
"php": "7.4.* || 8.0.* || 8.1.* || 8.2.* || 8.3.*",
"ext-xmlreader": "*",
"ext-simplexml": "*",
"ext-xmlwriter": "*",
Expand Down
2 changes: 1 addition & 1 deletion src/Message/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function downloadMessage(string $filePath, int $messageId): bool
&& $reader->depth === 1
&& $reader->name == 'MESSAGE'
) {
$filePut = file_put_contents($filePath, $reader->readOuterXml());
$filePut = (bool)file_put_contents($filePath, $reader->readOuterXml());
$reader->close();
return $filePut;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Order/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(Client $client)
$this->client = $client;
}

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

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

while ($reader->read()) {
if (
$reader->nodeType == XMLReader::ELEMENT
&& $reader->depth === 1
&& $reader->name == 'ORDER'
) {
$filePut = file_put_contents($filePath, $reader->readOuterXml());
$filePut = (bool)file_put_contents($filePath, $reader->readOuterXml());
$reader->close();
return $filePut;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Order/Tborder/Iterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Iterator extends Base\Iterator implements \Iterator
{
private ?Order $current = null;

public function current(): Order
public function current(): ?Order
{
return $this->current;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Product/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __construct(Client $client)
$this->client = $client;
}

public function getProduct(int $productId, int $channelId): Product
public function getProduct(int $productId, int $channelId): ?Product
{
$catalog = new Tbcat($this->client, 'products/', ['p_id' => $productId, 'channel' => $channelId]);
$productIterator = $catalog->getProducts();
Expand Down Expand Up @@ -52,7 +52,7 @@ public function downloadProduct(string $filePath, int $productId, int $channelId
&& $reader->depth === 2
&& $reader->name == 'PRODUCT'
) {
$filePut = file_put_contents($filePath, $reader->readOuterXml());
$filePut = (bool)file_put_contents($filePath, $reader->readOuterXml());
$reader->close();
return $filePut;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Product/Tbcat/Iterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function getSupplierName(): ?string
return $this->supplierName;
}

public function current(): Product
public function current(): ?Product
{
return $this->current;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Stock/Tbstock/Iterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function getChangeDate(): ?string
return $this->changeDate;
}

public function current(): Stock
public function current(): ?Stock
{
return $this->current;
}
Expand Down

0 comments on commit 1a0286e

Please sign in to comment.