Skip to content

Commit 6e30c28

Browse files
authored
Move symfony apcu polyfil to dev dependencies (#68)
Signed-off-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de>
1 parent 4b9f0d0 commit 6e30c28

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

composer.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
},
1717
"require": {
1818
"php": "^7.2|^8.0",
19-
"ext-json": "*",
20-
"symfony/polyfill-apcu": "^1.6"
19+
"ext-json": "*"
2120
},
2221
"require-dev": {
2322
"guzzlehttp/guzzle": "^6.3|^7.0",
@@ -26,12 +25,14 @@
2625
"phpstan/phpstan-phpunit": "^0.12.16",
2726
"phpstan/phpstan-strict-rules": "^0.12.5",
2827
"phpunit/phpunit": "^8.4|^9.4",
29-
"squizlabs/php_codesniffer": "^3.5"
28+
"squizlabs/php_codesniffer": "^3.5",
29+
"symfony/polyfill-apcu": "^1.6"
3030
},
3131
"suggest": {
3232
"ext-redis": "Required if using Redis.",
3333
"ext-apc": "Required if using APCu.",
34-
"promphp/prometheus_push_gateway_php": "An easy client for using Prometheus PushGateway."
34+
"promphp/prometheus_push_gateway_php": "An easy client for using Prometheus PushGateway.",
35+
"symfony/polyfill-apcu": "Required if you use APCu on PHP8.0+"
3536
},
3637
"autoload": {
3738
"psr-4": {

src/Prometheus/Storage/Redis.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,15 +285,15 @@ public function updateSummary(array $data): void
285285
if (false === $json) {
286286
throw new RuntimeException(json_last_error_msg());
287287
}
288-
$this->redis->setnx($metaKey, $json);
288+
$this->redis->setNx($metaKey, $json);
289289

290290
// store value key
291291
$valueKey = $summaryKey . ':' . $this->valueKey($data);
292292
$json = json_encode($this->encodeLabelValues($data['labelValues']));
293293
if (false === $json) {
294294
throw new RuntimeException(json_last_error_msg());
295295
}
296-
$this->redis->setnx($valueKey, $json);
296+
$this->redis->setNx($valueKey, $json);
297297

298298
// trick to handle uniqid collision
299299
$done = false;

0 commit comments

Comments
 (0)