Skip to content

Commit c25d81d

Browse files
committed
update dependencies, fix yaml empty-map format for symfony/yaml >= 8.1
1 parent 5a991da commit c25d81d

3 files changed

Lines changed: 22 additions & 21 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ A simple decode/encode solution for json / jsonx / url-encoded / xml / yaml.
2626
## Requirements
2727

2828
* php: ^8.3
29-
* symfony/yaml: ^6.4.30|^7.4.1|^8.0.1
29+
* symfony/yaml: ^6.4.42|^7.4.14|^8.1.1
3030

3131
## Suggest
3232

‎composer.json‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@
2323
"ext-dom": "*",
2424
"ext-json": "*",
2525
"ext-mbstring": "*",
26-
"symfony/yaml": "^6.4.30|^7.4.1|^8.0.1"
26+
"symfony/yaml": "^6.4.42|^7.4.14|^8.1.1"
2727
},
2828
"require-dev": {
29-
"chubbyphp/chubbyphp-container": "^2.4.1",
29+
"chubbyphp/chubbyphp-container": "^2.5.1",
3030
"chubbyphp/chubbyphp-dev-helper": "dev-master",
31-
"chubbyphp/chubbyphp-laminas-config-factory": "^1.5.1",
32-
"chubbyphp/chubbyphp-mock": "^2.1.2",
33-
"infection/infection": "^0.32.3",
31+
"chubbyphp/chubbyphp-laminas-config-factory": "^1.5.2",
32+
"chubbyphp/chubbyphp-mock": "^2.2.1",
33+
"infection/infection": "^0.34.0",
3434
"php-coveralls/php-coveralls": "^2.9.1",
3535
"phpstan/extension-installer": "^1.4.3",
36-
"phpstan/phpstan": "^2.1.33",
37-
"phpunit/phpunit": "^12.5.6",
36+
"phpstan/phpstan": "^2.2.5",
37+
"phpunit/phpunit": "^12.5.30",
3838
"psr/container": "^2.0.2"
3939
},
4040
"autoload": {

‎tests/Unit/Encoder/YamlTypeEncoderTest.php‎

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ public function testFormat(array $data): void
2727
{
2828
$yamlencoder = new YamlTypeEncoder();
2929

30-
$yaml = $yamlencoder->encode($data);
30+
// symfony/yaml < 8.1 dumps empty maps as '{ }', newer versions as '{}'
31+
$yaml = str_replace('{ }', '{}', $yamlencoder->encode($data));
3132

3233
$expectedYaml = <<<'EOT'
3334
page: 1
@@ -49,19 +50,19 @@ public function testFormat(array $data): void
4950
read:
5051
href: 'http://test.com/items/id1'
5152
templated: false
52-
rels: { }
53+
rels: {}
5354
attributes:
5455
method: GET
5556
update:
5657
href: 'http://test.com/items/id1'
5758
templated: false
58-
rels: { }
59+
rels: {}
5960
attributes:
6061
method: PUT
6162
delete:
6263
href: 'http://test.com/items/id1'
6364
templated: false
64-
rels: { }
65+
rels: {}
6566
attributes:
6667
method: DELETE
6768
items:
@@ -78,19 +79,19 @@ public function testFormat(array $data): void
7879
read:
7980
href: 'http://test.com/items/id1'
8081
templated: false
81-
rels: { }
82+
rels: {}
8283
attributes:
8384
method: GET
8485
update:
8586
href: 'http://test.com/items/id1'
8687
templated: false
87-
rels: { }
88+
rels: {}
8889
attributes:
8990
method: PUT
9091
delete:
9192
href: 'http://test.com/items/id1'
9293
templated: false
93-
rels: { }
94+
rels: {}
9495
attributes:
9596
method: DELETE
9697
-
@@ -107,19 +108,19 @@ public function testFormat(array $data): void
107108
read:
108109
href: 'http://test.com/items/id2'
109110
templated: false
110-
rels: { }
111+
rels: {}
111112
attributes:
112113
method: GET
113114
update:
114115
href: 'http://test.com/items/id2'
115116
templated: false
116-
rels: { }
117+
rels: {}
117118
attributes:
118119
method: PUT
119120
delete:
120121
href: 'http://test.com/items/id2'
121122
templated: false
122-
rels: { }
123+
rels: {}
123124
attributes:
124125
method: DELETE
125126
-
@@ -137,19 +138,19 @@ public function testFormat(array $data): void
137138
read:
138139
href: 'http://test.com/items/id3'
139140
templated: false
140-
rels: { }
141+
rels: {}
141142
attributes:
142143
method: GET
143144
update:
144145
href: 'http://test.com/items/id3'
145146
templated: false
146-
rels: { }
147+
rels: {}
147148
attributes:
148149
method: PUT
149150
delete:
150151
href: 'http://test.com/items/id3'
151152
templated: false
152-
rels: { }
153+
rels: {}
153154
attributes:
154155
method: DELETE
155156
_links:

0 commit comments

Comments
 (0)