Skip to content

Commit

Permalink
Drop PHP 7.4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
LeSuisse committed Nov 24, 2021
1 parent 0f1871a commit 729b7cb
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/CI.yml
Expand Up @@ -19,7 +19,7 @@ jobs:
- 6379/tcp
strategy:
matrix:
php: ['7.4', '8.0']
php: ['8.0']
dependencies: ['', '--prefer-lowest --prefer-stable']
steps:
- name: Checkout
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
uses: actions/checkout@v2.4.0
- uses: shivammathur/setup-php@2.15.0
with:
php-version: '7.4'
php-version: '8.0'
extensions: mbstring, redis, apcu
ini-values: apc.enable_cli=1, zend.assertions=1
coverage: pcov
Expand All @@ -78,7 +78,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
php: [ '7.4', '8.0' ]
php: [ '8.0' ]
steps:
- name: Checkout
uses: actions/checkout@v2.4.0
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
uses: actions/checkout@v2.4.0
- uses: shivammathur/setup-php@2.15.0
with:
php-version: '7.4'
php-version: '8.0'
extensions: mbstring, redis, apcu
coverage: none
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -3,7 +3,7 @@
"description": "Prometheus instrumentation library",
"license": "Apache-2.0",
"require": {
"php": "~7.4.0|~8.0.0",
"php": "~8.0.0",
"ext-json": "*",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0",
Expand Down
3 changes: 0 additions & 3 deletions src/Renderer/RenderTextFormat.php
Expand Up @@ -9,10 +9,8 @@

use function array_combine;
use function array_merge;
use function assert;
use function count;
use function implode;
use function is_array;
use function sprintf;
use function str_replace;
use function strcmp;
Expand Down Expand Up @@ -69,7 +67,6 @@ private static function renderSample(MetricFamilySamples $metric, Sample $sample
}

$labels = array_combine($allLabelNames, $labelValues);
assert(is_array($labels));
foreach ($labels as $labelName => $labelValue) {
$escapedLabels[] = $labelName . '="' . self::escapeLabelValue($labelValue) . '"';
}
Expand Down
3 changes: 1 addition & 2 deletions tests/stubs/Http/Promise/Promise.phpstub
Expand Up @@ -10,8 +10,7 @@ namespace Http\Promise;
interface Promise
{
/**
* @return mixed
* @psalm-return ($unwrap is true ? T : null)
*/
public function wait(bool $unwrap = true);
public function wait(bool $unwrap = true): mixed;
}
2 changes: 1 addition & 1 deletion tests/unit/Storage/CounterBaseTest.php
Expand Up @@ -179,7 +179,7 @@ public function isShouldAcceptAnySequenceOfBasicLatinCharactersForLabelValues(st
self::assertContainsOnlyInstancesOf(Sample::class, $samples);

foreach ($samples as $sample) {
$labels = (array) array_combine(
$labels = array_combine(
array_merge($metric->getLabelNames(), $sample->getLabelNames()),
$sample->getLabelValues()
);
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Storage/GaugeBaseTest.php
Expand Up @@ -294,7 +294,7 @@ public function isShouldAcceptAnySequenceOfBasicLatinCharactersForLabelValues(st
self::assertContainsOnlyInstancesOf(Sample::class, $samples);

foreach ($samples as $sample) {
$labels = (array) array_combine(
$labels = array_combine(
array_merge($metric->getLabelNames(), $sample->getLabelNames()),
$sample->getLabelValues()
);
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Storage/HistogramBaseTest.php
Expand Up @@ -250,7 +250,7 @@ public function isShouldAcceptAnySequenceOfBasicLatinCharactersForLabelValues(st
self::assertContainsOnlyInstancesOf(Sample::class, $samples);

foreach ($samples as $sample) {
$labels = (array) array_combine(
$labels = array_combine(
array_merge($metric->getLabelNames(), $sample->getLabelNames()),
$sample->getLabelValues()
);
Expand Down

0 comments on commit 729b7cb

Please sign in to comment.