Skip to content

Commit 139abd9

Browse files
kimpepperpalgaliknickschuch
authored
symfony6 (#7)
* Support Symfony 6 * Update deps * Allow plugin * Fix phpunit --------- Co-authored-by: Gálik Pál <[email protected]> Co-authored-by: Nick Schuch <[email protected]>
1 parent ce75c40 commit 139abd9

File tree

4 files changed

+25
-29
lines changed

4 files changed

+25
-29
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
type: string
1717
default: ""
1818
docker:
19-
- image: skpr/php-circleci:7.4-1.x
19+
- image: skpr/php-circleci:8.1-v2-latest
2020
working_directory: /data
2121
steps:
2222
- checkout
@@ -25,7 +25,7 @@ jobs:
2525
- deps-{{ arch }}
2626
- run:
2727
name: "Install Dependencies"
28-
command: composer update --prefer-dist --no-progress --no-suggest --no-interaction <<parameters.composer_args>>
28+
command: composer update --prefer-dist --no-progress --no-interaction <<parameters.composer_args>>
2929
- save_cache:
3030
key: deps-{{ arch }}
3131
paths:

composer.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
}
1010
],
1111
"require": {
12-
"php": "^7.2||^8.0",
12+
"php": "^8.1|^8.2",
1313
"ext-json": "*",
14-
"symfony/property-access": "^3.4||^4.4||^5.0",
15-
"symfony/serializer": "^3.4||^4.4||^5.0"
14+
"symfony/property-access": "^4.4|^5.4|^6.2",
15+
"symfony/serializer": "^4.4|^5.4|^6.2"
1616
},
1717
"require-dev": {
18-
"drupal/coder": "^8.3.8",
19-
"phpunit/phpunit": "^8.5.4",
20-
"symfony/phpunit-bridge": "^4.4.8"
18+
"drupal/coder": "^8.3.16",
19+
"phpunit/phpunit": "^9.5.28",
20+
"phpspec/prophecy": "^1.16",
21+
"symfony/phpunit-bridge": "^5.4"
2122
},
2223
"autoload": {
2324
"psr-4": {"PNX\\Prometheus\\": "src/"}
@@ -30,6 +31,9 @@
3031
"preferred-install": {
3132
"*": "dist"
3233
},
33-
"sort-packages": true
34+
"sort-packages": true,
35+
"allow-plugins": {
36+
"dealerdirect/phpcodesniffer-composer-installer": true
37+
}
3438
}
3539
}

phpunit.xml

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
32
<!-- TODO set checkForUnintentionallyCoveredCode="true" once https://www.drupal.org/node/2626832 is resolved. -->
43
<!-- PHPUnit expects functional tests to be run with either a privileged user
54
or your current system user. See core/tests/README.md and
65
https://www.drupal.org/node/2116263 for details.
76
-->
8-
<phpunit bootstrap="tests/bootstrap.php" colors="true"
9-
beStrictAboutTestsThatDoNotTestAnything="true"
10-
beStrictAboutOutputDuringTests="true"
11-
beStrictAboutChangesToGlobalState="true">
7+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="tests/bootstrap.php" colors="true" beStrictAboutTestsThatDoNotTestAnything="true" beStrictAboutOutputDuringTests="true" beStrictAboutChangesToGlobalState="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
8+
<coverage>
9+
<include>
10+
<directory>./src</directory>
11+
</include>
12+
<exclude>
13+
<directory suffix="Test.php">./</directory>
14+
<directory suffix="TestBase.php">./</directory>
15+
</exclude>
16+
</coverage>
1217
<php>
1318
<!-- Set error reporting to E_ALL. -->
1419
<ini name="error_reporting" value="32767"/>
@@ -20,23 +25,10 @@
2025
<testsuite name="unit">
2126
<directory>./tests/Unit</directory>
2227
</testsuite>
23-
<testsuite name="functional">
24-
<directory>./tests/Functional</directory>
25-
</testsuite>
2628
</testsuites>
2729
<listeners>
2830
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener">
2931
</listener>
3032
</listeners>
3133
<!-- Filter for coverage reports. -->
32-
<filter>
33-
<whitelist>
34-
<directory>./src</directory>
35-
<!-- By definition test classes have no tests. -->
36-
<exclude>
37-
<directory suffix="Test.php">./</directory>
38-
<directory suffix="TestBase.php">./</directory>
39-
</exclude>
40-
</whitelist>
41-
</filter>
4234
</phpunit>

src/Serializer/PrometheusEncoder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ class PrometheusEncoder implements EncoderInterface {
1414
/**
1515
* {@inheritdoc}
1616
*/
17-
public function supportsEncoding($format) {
17+
public function supportsEncoding($format): bool {
1818
return $format == self::ENCODING;
1919
}
2020

2121
/**
2222
* {@inheritdoc}
2323
*/
24-
public function encode($data, $format, array $context = []) {
24+
public function encode($data, $format, array $context = []): string {
2525
$output = [];
2626
$output[] = '# HELP ' . $data['name'] . ' ' . $data['help'];
2727
$output[] = '# TYPE ' . $data['name'] . ' ' . $data['type'];

0 commit comments

Comments
 (0)