Skip to content

Commit 8f5c1b8

Browse files
committed
Downgrade minimum PHP version to 8.1, update workflows and Dockerfile for compatibility, refine logger constants, and enhance QA tooling.
1 parent cfc8262 commit 8f5c1b8

6 files changed

Lines changed: 23 additions & 21 deletions

File tree

.docker/php/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:cli-alpine AS php-base
1+
FROM php:8.1-cli-alpine AS php-base
22

33
# Install composer
44
ENV COMPOSER_ALLOW_SUPERUSER 1

.github/workflows/publish-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- name: Setup PHP
6161
uses: shivammathur/setup-php@v2
6262
with:
63-
php-version: "8.2"
63+
php-version: "8.1"
6464
extensions: json, curl
6565

6666
- name: Install dependencies

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Packagist Version](https://img.shields.io/packagist/v/logdash/php-sdk)](https://packagist.org/packages/logdash/php-sdk)
44
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5-
[![PHP Version](https://img.shields.io/badge/PHP-8.2+-blue.svg)](https://php.net)
5+
[![PHP Version](https://img.shields.io/badge/PHP-8.1+-blue.svg)](https://php.net)
66
[![Tests](https://github.com/logdash-io/php-sdk/workflows/Tests/badge.svg)](https://github.com/logdash-io/php-sdk/actions)
77

88
> **Official PHP SDK for [Logdash.io](https://logdash.io/) - Zero-configuration observability platform designed for developers working on side projects and prototypes.**
@@ -20,7 +20,7 @@ Most observability solutions feel overwhelming for small projects and prototypes
2020
- **⚡ Asynchronous**: Non-blocking operations with automatic resource management
2121
- **🛡️ Production Ready**: Built with enterprise-grade patterns and error handling
2222
- **🔧 Framework Agnostic**: Works with Laravel, Symfony, or standalone PHP apps
23-
- **🐘 PHP 8.2+ Compatible**: Supports PHP 8.2, 8.3, and all newer versions
23+
- **🐘 PHP 8.1+ Compatible**: Supports PHP 8.1, 8.2, 8.3, and all newer versions
2424

2525
## Pre-requisites
2626

@@ -222,7 +222,7 @@ The SDK is designed to be non-blocking and fail silently in production. If there
222222

223223
## Requirements
224224

225-
- PHP 8.2 or higher
225+
- PHP 8.1 or higher
226226
- Guzzle HTTP client (automatically installed via Composer)
227227

228228
## Development

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@
1818
],
1919
"homepage": "https://github.com/logdash-io/php-sdk",
2020
"require": {
21-
"php": ">=8.2",
21+
"php": ">=8.1",
2222
"guzzlehttp/guzzle": "^7.0"
2323
},
2424
"require-dev": {
2525
"phpunit/phpunit": "^10.0",
2626
"phpstan/phpstan": "^1.10",
27-
"squizlabs/php_codesniffer": "^3.7"
27+
"squizlabs/php_codesniffer": "^3.7",
28+
"php-parallel-lint/php-parallel-lint": "^1.4"
2829
},
2930
"autoload": {
3031
"psr-4": {
@@ -47,6 +48,7 @@
4748
"cbf": "phpcbf",
4849
"qa": {
4950
"Codestyle": "@cs",
51+
"Lint": "parallel-lint src tests",
5052
"Static analyse": "@phpstan",
5153
"Tests": "@test"
5254
},

src/Logger/InternalLogger.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ class InternalLogger
1010
{
1111
private static self $instance;
1212
private const LOG_LEVEL_COLORS = [
13-
LogLevel::ERROR->value => [231, 0, 11],
14-
LogLevel::WARN->value => [254, 154, 0],
15-
LogLevel::INFO->value => [21, 93, 252],
16-
LogLevel::HTTP->value => [0, 166, 166],
17-
LogLevel::VERBOSE->value => [0, 166, 0],
18-
LogLevel::DEBUG->value => [0, 166, 0],
19-
LogLevel::SILLY->value => [80, 80, 80],
13+
'error' => [231, 0, 11],
14+
'warning' => [254, 154, 0],
15+
'info' => [21, 93, 252],
16+
'http' => [0, 166, 166],
17+
'verbose' => [0, 166, 0],
18+
'debug' => [0, 166, 0],
19+
'silly' => [80, 80, 80],
2020
];
2121

2222
public function log(string ...$data): void

src/Logger/Logger.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
class Logger
1010
{
1111
private const LOG_LEVEL_COLORS = [
12-
LogLevel::ERROR->value => [231, 0, 11],
13-
LogLevel::WARN->value => [254, 154, 0],
14-
LogLevel::INFO->value => [21, 93, 252],
15-
LogLevel::HTTP->value => [0, 166, 166],
16-
LogLevel::VERBOSE->value => [0, 166, 0],
17-
LogLevel::DEBUG->value => [0, 166, 0],
18-
LogLevel::SILLY->value => [80, 80, 80],
12+
'error' => [231, 0, 11],
13+
'warning' => [254, 154, 0],
14+
'info' => [21, 93, 252],
15+
'http' => [0, 166, 166],
16+
'verbose' => [0, 166, 0],
17+
'debug' => [0, 166, 0],
18+
'silly' => [80, 80, 80],
1919
];
2020

2121
private readonly mixed $logMethod;

0 commit comments

Comments
 (0)