diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 71ad266..f033641 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -11,10 +11,10 @@ jobs: name: Code Checks steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.composer/cache/files key: dependencies-code-checks diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8e5ffdb..acd88cf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,17 +9,17 @@ jobs: fail-fast: true matrix: os: [ ubuntu-latest ] - php: [ 7.4, 8.0, 8.1 ] + php: [ 7.4, 8.0, 8.1, 8.2 ] dependency-version: [ prefer-lowest, prefer-stable ] name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.composer/cache/files key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} diff --git a/composer.json b/composer.json index fa3184b..3255433 100644 --- a/composer.json +++ b/composer.json @@ -4,14 +4,14 @@ "type": "library", "require": { "php": "^7.2|^8.0", - "guzzlehttp/guzzle": "^6.3|^7.0", + "guzzlehttp/guzzle": "^7.0", "promphp/prometheus_client_php": "^1.0|^2.0" }, "require-dev": { "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5.4", - "phpstan/phpstan-phpunit": "^1.1.0", - "phpstan/phpstan-strict-rules": "^1.1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.1", "phpunit/phpunit": "^9.4", "squizlabs/php_codesniffer": "^3.6" }, @@ -31,5 +31,10 @@ "psr-0": { "Test\\PrometheusPushGateway\\": "tests/" } + }, + "config": { + "allow-plugins": { + "phpstan/extension-installer": true + } } } diff --git a/src/PrometheusPushGateway/PushGateway.php b/src/PrometheusPushGateway/PushGateway.php index a16cc89..f5ee4e5 100644 --- a/src/PrometheusPushGateway/PushGateway.php +++ b/src/PrometheusPushGateway/PushGateway.php @@ -13,9 +13,9 @@ class PushGateway { - const HTTP_PUT = "PUT"; - const HTTP_POST = "POST"; - const HTTP_DELETE = "DELETE"; + public const HTTP_PUT = "PUT"; + public const HTTP_POST = "POST"; + public const HTTP_DELETE = "DELETE"; /** * @var string */ @@ -42,7 +42,7 @@ public function __construct(string $address, ?ClientInterface $client = null) * Uses HTTP PUT. * @param CollectorRegistry $collectorRegistry * @param string $job - * @param array $groupingKey + * @param array $groupingKey * @throws GuzzleException */ public function push(CollectorRegistry $collectorRegistry, string $job, array $groupingKey = []): void @@ -55,7 +55,7 @@ public function push(CollectorRegistry $collectorRegistry, string $job, array $g * Uses HTTP POST. * @param CollectorRegistry $collectorRegistry * @param string $job - * @param array $groupingKey + * @param array $groupingKey * @throws GuzzleException */ public function pushAdd(CollectorRegistry $collectorRegistry, string $job, array $groupingKey = []): void @@ -67,7 +67,7 @@ public function pushAdd(CollectorRegistry $collectorRegistry, string $job, array * Deletes metrics from the Push Gateway. * Uses HTTP POST. * @param string $job - * @param array $groupingKey + * @param array $groupingKey * @throws GuzzleException */ public function delete(string $job, array $groupingKey = []): void @@ -78,7 +78,7 @@ public function delete(string $job, array $groupingKey = []): void /** * @param CollectorRegistry|null $collectorRegistry * @param string $job - * @param array $groupingKey + * @param array $groupingKey * @param string $method * @throws GuzzleException */