Skip to content

Commit 47ed092

Browse files
committed
Fix PHPStan issues
Signed-off-by: simonhammes <simonhammes@users.noreply.github.com>
1 parent a407f5b commit 47ed092

File tree

6 files changed

+5
-18
lines changed

6 files changed

+5
-18
lines changed

phpstan/include-by-php-version.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44

55
$includes = [];
66

7-
if (PHP_VERSION_ID >= 70400) {
8-
$includes[] = __DIR__ . '/php-74.neon';
9-
}
10-
117
if (PHP_VERSION_ID >= 80000) {
128
$includes[] = __DIR__ . '/php-80.neon';
139
}

phpstan/php-74.neon

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/Prometheus/Storage/APCng.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ private function buildPermutationTree(array $labelValues): \Generator /** @phpst
438438
if (count($labelValues) > 0) {
439439
$lastIndex = array_key_last($labelValues);
440440
$currentValue = array_pop($labelValues);
441-
if ($currentValue != null) {
441+
if ($currentValue !== null) {
442442
foreach ($this->buildPermutationTree($labelValues) as $prefix) {
443443
foreach ($currentValue as $value) {
444444
yield $prefix + [$lastIndex => $value];

src/Prometheus/Storage/PDO.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ protected function createTables(): void
597597

598598
$this->database->query($sql);
599599

600-
$hash_size = $driver == 'sqlite' ? 32 : 64;
600+
$hash_size = $driver === 'sqlite' ? 32 : 64;
601601

602602
switch ($driver) {
603603
case 'pgsql':
@@ -627,7 +627,7 @@ protected function createTables(): void
627627

628628
$this->database->query($sql);
629629

630-
$timestamp_type = $driver == 'sqlite' ? 'timestamp' : 'int';
630+
$timestamp_type = $driver === 'sqlite' ? 'timestamp' : 'int';
631631
$sqlIndex = null;
632632

633633
switch ($driver) {

src/Prometheus/Storage/Redis.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ private function collectHistograms(): array
429429
$allLabelValues = [];
430430
foreach (array_keys($raw) as $k) {
431431
$d = json_decode($k, true);
432-
if ($d['b'] == 'sum') {
432+
if ($d['b'] === 'sum') {
433433
continue;
434434
}
435435
$allLabelValues[] = $d['labelValues'];

src/Prometheus/Storage/RedisNg.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ private function collectHistograms(): array
428428
$allLabelValues = [];
429429
foreach (array_keys($raw) as $k) {
430430
$d = json_decode($k, true);
431-
if ($d['b'] == 'sum') {
431+
if ($d['b'] === 'sum') {
432432
continue;
433433
}
434434
$allLabelValues[] = $d['labelValues'];
@@ -534,9 +534,6 @@ private function collectSummaries(): array
534534
$samples = [];
535535
foreach ($values as $valueKey) {
536536
$rawValue = explode(":", $valueKey);
537-
if ($rawValue === false) {
538-
continue;
539-
}
540537
$encodedLabelValues = $rawValue[2];
541538
$decodedLabelValues = $this->decodeLabelValues($encodedLabelValues);
542539

0 commit comments

Comments
 (0)