Skip to content

Commit 8bfdb09

Browse files
Denis-AverinIvan Kamkin
andauthored
Add PHP 8.4 to support (#81)
* Replace PHP version 7.4 with version 8.4 * Update PHPUnit to version >=10.0 * Add jUnit logging * Fix PHPUnit config * Set failOnDeprecation="true" * Fixed nullable_type_declaration_for_default_null_value issue in 8.4 --------- Co-authored-by: Ivan Kamkin <234-Ivan.Kamkin@users.noreply.git.saltov.dynabic.com>
1 parent 519e007 commit 8bfdb09

18 files changed

Lines changed: 23 additions & 19 deletions

.github/workflows/php-versions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
matrix:
4545
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
4646
# See: https://www.php.net/supported-versions
47-
php-versions: ['7.4', '8.1', '8.2', '8.3']
47+
php-versions: [ '8.1', '8.2', '8.3', '8.4' ]
4848
continue-on-error: true
4949

5050
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@
125125
}
126126
],
127127
"require": {
128-
"php": ">=7.4 || >=8.0",
128+
"php": ">=8.0",
129129
"guzzlehttp/guzzle": "^7.4",
130130
"ext-json": "*"
131131
},
132132
"require-dev": {
133-
"phpunit/phpunit": ">=7.5.20",
133+
"phpunit/phpunit": ">=10.0",
134134
"friendsofphp/php-cs-fixer": ">=2.16",
135135
"phpstan/phpstan": "^1.9"
136136
},

php-cs-fixer.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
$config = new PhpCsFixer\Config();
44
return $config->setRules([
55
'@PSR12' => true,
6+
'nullable_type_declaration_for_default_null_value' => true,
67
])
78
;

phpunit.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd" bootstrap="vendor/autoload.php" executionOrder="depends,defects" beStrictAboutOutputDuringTests="true" failOnRisky="true" failOnWarning="true">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd" bootstrap="vendor/autoload.php" executionOrder="depends,defects" beStrictAboutOutputDuringTests="true" failOnRisky="true" failOnWarning="true" failOnDeprecation="true">
33
<testsuites>
44
<testsuite name="default">
55
<directory>tests</directory>
@@ -11,4 +11,7 @@
1111
<directory suffix=".php">src</directory>
1212
</include>
1313
</source>
14+
<logging>
15+
<junit outputFile="phpunit-log.xml" />
16+
</logging>
1417
</phpunit>

src/Aspose/BarCode/GenerateApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class GenerateApi
7171
* @param Configuration|null $config configuration info
7272
* @param HeaderSelector|null $selector class for header selection
7373
*/
74-
public function __construct(ClientInterface $client = null, Configuration $config = null, HeaderSelector $selector = null)
74+
public function __construct(?ClientInterface $client = null, ?Configuration $config = null, ?HeaderSelector $selector = null)
7575
{
7676
$this->client = $client ?: new Client();
7777
$this->config = $config ?: new Configuration();

src/Aspose/BarCode/Model/ApiError.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public function getModelName()
167167
* @param mixed[] $data Associated array of property values
168168
* initializing the model
169169
*/
170-
public function __construct(array $data = null)
170+
public function __construct(?array $data = null)
171171
{
172172
$this->container['code'] = isset($data['code']) ? $data['code'] : null;
173173
$this->container['message'] = isset($data['message']) ? $data['message'] : null;

src/Aspose/BarCode/Model/ApiErrorResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function getModelName()
152152
* @param mixed[] $data Associated array of property values
153153
* initializing the model
154154
*/
155-
public function __construct(array $data = null)
155+
public function __construct(?array $data = null)
156156
{
157157
$this->container['request_id'] = isset($data['request_id']) ? $data['request_id'] : null;
158158
$this->container['error'] = isset($data['error']) ? $data['error'] : null;

src/Aspose/BarCode/Model/BarcodeImageParams.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public function getModelName()
187187
* @param mixed[] $data Associated array of property values
188188
* initializing the model
189189
*/
190-
public function __construct(array $data = null)
190+
public function __construct(?array $data = null)
191191
{
192192
$this->container['image_format'] = isset($data['image_format']) ? $data['image_format'] : null;
193193
$this->container['text_location'] = isset($data['text_location']) ? $data['text_location'] : null;

src/Aspose/BarCode/Model/BarcodeResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public function getModelName()
162162
* @param mixed[] $data Associated array of property values
163163
* initializing the model
164164
*/
165-
public function __construct(array $data = null)
165+
public function __construct(?array $data = null)
166166
{
167167
$this->container['barcode_value'] = isset($data['barcode_value']) ? $data['barcode_value'] : null;
168168
$this->container['type'] = isset($data['type']) ? $data['type'] : null;

src/Aspose/BarCode/Model/BarcodeResponseList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function getModelName()
147147
* @param mixed[] $data Associated array of property values
148148
* initializing the model
149149
*/
150-
public function __construct(array $data = null)
150+
public function __construct(?array $data = null)
151151
{
152152
$this->container['barcodes'] = isset($data['barcodes']) ? $data['barcodes'] : null;
153153
}

0 commit comments

Comments
 (0)