diff --git a/AGENTS.md b/AGENTS.md index 0897e0a6..1fa7c1d7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -23,7 +23,7 @@ All code in this project MUST adhere to the coding standards, naming conventions Key constraints include: -* PHP 7.4 as the minimum required version. +* PHP 7.4.12 as the minimum required version (PHP 7.4.0–7.4.11 have a known covariant return type bug that causes fatal errors with this codebase). * PER Coding Style (extending PSR-12). * Strict type hinting for all parameters, return values, and properties. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7d1871f0..c0085a91 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -73,7 +73,7 @@ Note that `list` and `string[]` _are not_ the same. The latter is an ali ## PHP Compatibility -All code must be backward compatible with PHP 7.4, which is the minimum required PHP version for this project. +All code must be backward compatible with PHP 7.4.12, which is the minimum required PHP version for this project. PHP 7.4.0–7.4.11 have a known engine bug (https://bugs.php.net/bug.php?id=80126) that causes a fatal error with covariant return types in DTO inheritance; those patch releases are not supported. ## Running Tests diff --git a/README.md b/README.md index 4b55305f..d47b827b 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,10 @@ This project is a PHP SDK, which can be installed as a Composer package. In Word While this project is stewarded by [WordPress AI Team](https://make.wordpress.org/ai/) members and contributors, it is technically WordPress agnostic. The gap the project addresses is relevant for not only the WordPress ecosystem, but the overall PHP ecosystem, so any PHP project could benefit from it. There is also no technical reason to scope it to WordPress, as communicating with AI models and their providers is independent of WordPress's built-in APIs and paradigms. +## Requirements + +- PHP 7.4.12 or later (PHP 7.4.0–7.4.11 have a known covariant return type bug — see [PHP bug #80126](https://bugs.php.net/bug.php?id=80126)) + ## Installation ``` diff --git a/composer.json b/composer.json index 46e1280a..f2366088 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "source": "https://github.com/WordPress/php-ai-client" }, "require": { - "php": ">=7.4", + "php": ">=7.4.12", "ext-json": "*", "nyholm/psr7": "^1.8", "php-http/discovery": "^1.0", @@ -71,7 +71,7 @@ }, "optimize-autoloader": true, "platform": { - "php": "7.4" + "php": "7.4.12" }, "sort-packages": true }, diff --git a/composer.lock b/composer.lock index a010d40c..5f949fd3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ba8ef0c4a9742a79115e930f1f4a82f5", + "content-hash": "5c3d97a86fe789062b68f24e1cea48f6", "packages": [ { "name": "nyholm/psr7", @@ -3902,12 +3902,12 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.4", + "php": ">=7.4.12", "ext-json": "*" }, "platform-dev": {}, "platform-overrides": { - "php": "7.4" + "php": "7.4.12" }, "plugin-api-version": "2.9.0" } diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 2e49db44..f946a657 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -21,7 +21,7 @@ - +