Skip to content

Commit 8b7bebd

Browse files
authored
feat: webmozart/assert ^2.0 support (#15)
1 parent 20392a8 commit 8b7bebd

5 files changed

Lines changed: 7 additions & 6 deletions

File tree

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
/.releaserc.json export-ignore
1616
/infection.json5 export-ignore
1717
/docs/ export-ignore
18+
/rector.php export-ignore

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
"require": {
1313
"php": "^8.2",
1414
"psr/log": "^1.0 || ^2.0 || ^3.0",
15-
"webmozart/assert": "^1.11"
15+
"webmozart/assert": "^1.11 || ^2.0"
1616
},
1717
"require-dev": {
1818
"ergebnis/composer-normalize": "dev-main",
19-
"infection/infection": "^0.29.14",
19+
"infection/infection": "^0.32.6",
2020
"mockery/mockery": "^1.6.12",
2121
"phpcompatibility/php-compatibility": "^9.3.5",
2222
"phpmd/phpmd": "^2.15",
@@ -26,6 +26,7 @@
2626
"phpunit/phpunit": "^11.5.15",
2727
"rector/rector": "^2.0",
2828
"roave/security-advisories": "dev-latest",
29+
"savinmikhail/dist-size-optimizer": "^0.2.7",
2930
"slevomat/coding-standard": "^8.16.2",
3031
"squizlabs/php_codesniffer": "^3.12.1",
3132
"vimeo/psalm": "^6.10"
@@ -48,6 +49,7 @@
4849
"infection/extension-installer": true,
4950
"phpstan/extension-installer": true
5051
},
52+
"lock": true,
5153
"sort-packages": true
5254
},
5355
"scripts": {

src/KeySerialization/JsonSerializer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function unserialize(string $key): MetricNameWithLabels
4848
: [];
4949

5050
Assert::isArray($labels);
51-
Assert::allStringNotEmpty($labels);
51+
Assert::allStringNotEmpty($labels, 'Labels keys and values must be non-empty strings');
5252
/** @psalm-var array<non-empty-string, non-empty-string> $labels */
5353

5454
return new MetricNameWithLabels($name, $labels);

src/Metric/Summary.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ public function getQuantiles(): array
3030

3131
/**
3232
* @param non-empty-list<float> $quantiles
33-
*
34-
* @return $this
3533
*/
3634
public function withQuantiles(array $quantiles): self
3735
{

tests/KeySerialization/JsonSerializerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public static function unserializationErrorsDataProvider(): iterable
9898

9999
yield 'empty label' => [
100100
'foo|{"bar":""}',
101-
'Expected a different value than ""',
101+
'Labels keys and values must be non-empty strings',
102102
];
103103

104104
yield 'malformed json' => [

0 commit comments

Comments
 (0)