Skip to content

Commit

Permalink
Downgrade to PHP 8
Browse files Browse the repository at this point in the history
  • Loading branch information
antonkomarev committed Sep 1, 2024
1 parent bffb26a commit 686e0e4
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 8 deletions.
22 changes: 22 additions & 0 deletions .docker/php80/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# ----------------------
# The FPM base container
# ----------------------
FROM php:8.0-cli-alpine AS dev

RUN apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS

# Cleanup apk cache and temp files
RUN rm -rf /var/cache/apk/* /tmp/*

# ----------------------
# Composer install step
# ----------------------

# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

# ----------------------
# The FPM production container
# ----------------------
FROM dev
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.3, 8.2, 8.1]
php: [8.3, 8.2, 8.1, 8.0]
dependency-version: [prefer-lowest, prefer-stable]

name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
Expand Down
13 changes: 12 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
services:
php74:
php80:
container_name: php-open-tsdb-client-lib-80
image: php-open-tsdb-client-lib-80
build:
context: ./
dockerfile: ./.docker/php80/Dockerfile
tty: true
working_dir: /app
volumes:
- ./:/app

php81:
container_name: php-open-tsdb-client-lib-81
image: php-open-tsdb-client-lib-81
build:
Expand Down
8 changes: 4 additions & 4 deletions src/DataPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ final class DataPoint implements
* @param array<string, string> $tags A map of tag name/tag value pairs. At least one pair must be supplied.
*/
public function __construct(
private readonly string $metric,
private readonly int $timestamp,
private readonly int | float | string $value,
private readonly array $tags,
private string $metric,
private int $timestamp,
private int | float | string $value,
private array $tags,
) {
// TODO: Assert at least one tag value pair supplied
}
Expand Down
4 changes: 2 additions & 2 deletions src/OpenTsdbClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
final class OpenTsdbClient
{
public function __construct(
private readonly ClientInterface $httpClient,
private readonly string $baseUri,
private ClientInterface $httpClient,
private string $baseUri,
) {}

/**
Expand Down

0 comments on commit 686e0e4

Please sign in to comment.