Skip to content

Commit fa75413

Browse files
committed
php85
1 parent aeb7602 commit fa75413

File tree

7 files changed

+35
-50
lines changed

7 files changed

+35
-50
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,36 @@ on:
66
- cron: "0 0 * * *"
77

88
jobs:
9-
php82:
10-
name: PHP 8.2
9+
php83:
10+
name: PHP 8.3
1111
runs-on: ubuntu-24.04
1212
steps:
1313
- name: checkout
1414
uses: actions/checkout@v4
1515
- name: composer test
16-
uses: docker://ghcr.io/chubbyphp/ci-php82:latest
16+
uses: docker://ghcr.io/chubbyphp/ci-php83:latest
1717
env:
1818
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1919
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
20-
php83:
21-
name: PHP 8.3
20+
php84:
21+
name: PHP 8.4
2222
runs-on: ubuntu-24.04
2323
steps:
2424
- name: checkout
2525
uses: actions/checkout@v4
2626
- name: composer test
27-
uses: docker://ghcr.io/chubbyphp/ci-php83:latest
27+
uses: docker://ghcr.io/chubbyphp/ci-php84:latest
2828
env:
2929
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3030
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
31-
php84:
32-
name: PHP 8.4
31+
php85:
32+
name: PHP 8.5
3333
runs-on: ubuntu-24.04
3434
steps:
3535
- name: checkout
3636
uses: actions/checkout@v4
3737
- name: composer test
38-
uses: docker://ghcr.io/chubbyphp/ci-php84:latest
38+
uses: docker://ghcr.io/chubbyphp/ci-php85:latest
3939
env:
4040
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4141
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

.php-cs-fixer.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,8 @@
1212
/** @var array $config */
1313
$config = require __DIR__ . '/vendor/chubbyphp/chubbyphp-dev-helper/phpcs.php';
1414

15-
// drop onces code is >= 8.0
16-
unset($config['rules']['phpdoc_to_return_type']);
17-
18-
// drop once DateTimeFieldDenormalizer gets dropped
19-
unset($config['rules']['date_time_immutable']);
20-
2115
return (new PhpCsFixer\Config)
16+
->setUnsupportedPhpVersionAllowed(true)
2217
->setIndent($config['indent'])
2318
->setLineEnding($config['lineEnding'])
2419
->setRules($config['rules'])

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ A simple decode/encode solution for json / jsonx / url-encoded / xml / yaml.
2525

2626
## Requirements
2727

28-
* php: ^8.2
28+
* php: ^8.3
2929
* symfony/yaml: ^5.4.45|^6.4.18|^7.2
3030

3131
## Suggest
@@ -38,7 +38,7 @@ A simple decode/encode solution for json / jsonx / url-encoded / xml / yaml.
3838
Through [Composer](http://getcomposer.org) as [chubbyphp/chubbyphp-decode-encode][1].
3939

4040
```sh
41-
composer require chubbyphp/chubbyphp-decode-encode "^1.2"
41+
composer require chubbyphp/chubbyphp-decode-encode "^1.3"
4242
```
4343

4444
## Usage

composer.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@
1919
}
2020
],
2121
"require": {
22-
"php": "^8.2",
22+
"php": "^8.3",
2323
"ext-dom": "*",
2424
"ext-json": "*",
2525
"ext-mbstring": "*",
26-
"symfony/yaml": "^5.4.45|^6.4.18|^7.2"
26+
"symfony/yaml": "^5.4.45|^6.4.26|^7.4"
2727
},
2828
"require-dev": {
2929
"chubbyphp/chubbyphp-container": "^2.2",
3030
"chubbyphp/chubbyphp-dev-helper": "dev-master",
3131
"chubbyphp/chubbyphp-laminas-config-factory": "^1.4",
32-
"chubbyphp/chubbyphp-mock": "^2.0",
33-
"infection/infection": "^0.29.13",
34-
"php-coveralls/php-coveralls": "^2.7.0",
32+
"chubbyphp/chubbyphp-mock": "^2.0.1",
33+
"infection/infection": "^0.31.9",
34+
"php-coveralls/php-coveralls": "^2.9",
3535
"phpstan/extension-installer": "^1.4.3",
36-
"phpstan/phpstan": "^2.1.6",
37-
"phpunit/phpunit": "^11.5.10",
36+
"phpstan/phpstan": "^2.1.32",
37+
"phpunit/phpunit": "^12.4.5",
3838
"psr/container": "^2.0.2"
3939
},
4040
"autoload": {
@@ -56,7 +56,7 @@
5656
},
5757
"extra": {
5858
"branch-alias": {
59-
"dev-master": "1.2-dev"
59+
"dev-master": "1.3-dev"
6060
}
6161
},
6262
"scripts": {

src/Decoder/JsonxTypeDecoder.php

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
*/
1212
final class JsonxTypeDecoder implements TypeDecoderInterface
1313
{
14-
private const DATATYPE_OBJECT = 'object';
15-
private const DATATYPE_ARRAY = 'array';
16-
private const DATATYPE_BOOLEAN = 'boolean';
17-
private const DATATYPE_STRING = 'string';
18-
private const DATATYPE_NUMBER = 'number';
19-
private const DATATYPE_NULL = 'null';
14+
private const string DATATYPE_OBJECT = 'object';
15+
private const string DATATYPE_ARRAY = 'array';
16+
private const string DATATYPE_BOOLEAN = 'boolean';
17+
private const string DATATYPE_STRING = 'string';
18+
private const string DATATYPE_NUMBER = 'number';
19+
private const string DATATYPE_NULL = 'null';
2020

2121
public function getContentType(): string
2222
{
@@ -39,10 +39,7 @@ public function decode(string $data): array
3939
return $this->decodeNode($document->documentElement);
4040
}
4141

42-
/**
43-
* @return null|array|bool|float|int|string
44-
*/
45-
private function decodeNode(\DOMNode $node)
42+
private function decodeNode(\DOMNode $node): array|bool|float|int|string|null
4643
{
4744
$nodeName = $node->nodeName;
4845

@@ -69,7 +66,7 @@ private function decodeNode(\DOMNode $node)
6966
}
7067

7168
if (self::DATATYPE_NULL === $nodeType) {
72-
return;
69+
return null;
7370
}
7471

7572
throw RuntimeException::createNotParsable($this->getContentType());

src/Decoder/UrlEncodedTypeDecoder.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,8 @@ private function fixValues(array $rawData): array
4545
return $data;
4646
}
4747

48-
/**
49-
* @return null|bool|float|int|string
50-
*/
51-
private function fixValue(string $value)
48+
private function fixValue(string $value): bool|float|int|string|null
5249
{
53-
if ('' === $value) {
54-
return;
55-
}
56-
5750
if ('true' === $value) {
5851
return true;
5952
}

src/Encoder/JsonxTypeEncoder.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
*/
1010
final class JsonxTypeEncoder implements TypeEncoderInterface
1111
{
12-
public const DATATYPE_OBJECT = 'object';
13-
public const DATATYPE_ARRAY = 'array';
14-
public const DATATYPE_BOOLEAN = 'boolean';
15-
public const DATATYPE_STRING = 'string';
16-
public const DATATYPE_NUMBER = 'number';
17-
public const DATATYPE_NULL = 'null';
12+
public const string DATATYPE_OBJECT = 'object';
13+
public const string DATATYPE_ARRAY = 'array';
14+
public const string DATATYPE_BOOLEAN = 'boolean';
15+
public const string DATATYPE_STRING = 'string';
16+
public const string DATATYPE_NUMBER = 'number';
17+
public const string DATATYPE_NULL = 'null';
1818

1919
public function __construct(private bool $prettyPrint = false) {}
2020

0 commit comments

Comments
 (0)