diff --git a/.circleci/config.yml b/.circleci/config.yml index 6571e48..7ad8a15 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,7 @@ jobs: type: string default: "" docker: - - image: skpr/php-circleci:7.4-1.x + - image: skpr/php-circleci:8.1-v2-latest working_directory: /data steps: - checkout @@ -25,7 +25,7 @@ jobs: - deps-{{ arch }} - run: name: "Install Dependencies" - command: composer update --prefer-dist --no-progress --no-suggest --no-interaction <> + command: composer update --prefer-dist --no-progress --no-interaction <> - save_cache: key: deps-{{ arch }} paths: diff --git a/composer.json b/composer.json index 795a6de..e178a0e 100644 --- a/composer.json +++ b/composer.json @@ -9,15 +9,16 @@ } ], "require": { - "php": "^7.2||^8.0", + "php": "^8.1|^8.2", "ext-json": "*", - "symfony/property-access": "^3.4||^4.4||^5.0", - "symfony/serializer": "^3.4||^4.4||^5.0" + "symfony/property-access": "^4.4|^5.4|^6.2", + "symfony/serializer": "^4.4|^5.4|^6.2" }, "require-dev": { - "drupal/coder": "^8.3.8", - "phpunit/phpunit": "^8.5.4", - "symfony/phpunit-bridge": "^4.4.8" + "drupal/coder": "^8.3.16", + "phpunit/phpunit": "^9.5.28", + "phpspec/prophecy": "^1.16", + "symfony/phpunit-bridge": "^5.4" }, "autoload": { "psr-4": {"PNX\\Prometheus\\": "src/"} @@ -30,6 +31,9 @@ "preferred-install": { "*": "dist" }, - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } } } diff --git a/phpunit.xml b/phpunit.xml index 3ca5c26..e3c3655 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,14 +1,19 @@ - - + + + + ./src + + + ./ + ./ + + @@ -20,23 +25,10 @@ ./tests/Unit - - ./tests/Functional - - - - ./src - - - ./ - ./ - - - diff --git a/src/Serializer/PrometheusEncoder.php b/src/Serializer/PrometheusEncoder.php index f448f3c..44ba6d4 100644 --- a/src/Serializer/PrometheusEncoder.php +++ b/src/Serializer/PrometheusEncoder.php @@ -14,14 +14,14 @@ class PrometheusEncoder implements EncoderInterface { /** * {@inheritdoc} */ - public function supportsEncoding($format) { + public function supportsEncoding($format): bool { return $format == self::ENCODING; } /** * {@inheritdoc} */ - public function encode($data, $format, array $context = []) { + public function encode($data, $format, array $context = []): string { $output = []; $output[] = '# HELP ' . $data['name'] . ' ' . $data['help']; $output[] = '# TYPE ' . $data['name'] . ' ' . $data['type'];