cloudflare-php icon indicating copy to clipboard operation
cloudflare-php copied to clipboard

Explicitly declare nullable types to fix deprecation in PHP 8.4

Open xPaw opened this issue 11 months ago • 4 comments

PHP 8.4 deprecates implicitly nullable types.

You get a deprecation warning like so:

Cloudflare\API\Endpoints\Zones::cachePurge(): Implicitly marking parameter $hosts as nullable is deprecated, the explicit nullable type must be used instead in src/Endpoints/Zones.php:246

Nullable types are available since 7.1.0. There is CI action for PHP 7.0, but the composer requires has "php": ">=7.2.5"

xPaw avatar Jan 02 '25 18:01 xPaw

@jacobbednarz can you take a look? an easy fix

xPaw avatar Jan 07 '25 11:01 xPaw

Can someone review this pull request? My Sentry is filling up with errors because of these nullable types.

SindlaXYZ avatar Feb 03 '25 13:02 SindlaXYZ

For now you can require this pull request with a commit hash: composer require cloudflare/sdk:dev-master#541fb4e2c9942a3b660bb6a0db676f7c851c144c

xPaw avatar Feb 06 '25 11:02 xPaw

@jacobbednarz would you please merge this and tag new version? The library is not compatible with PHP 8.4 as of this moment, it's been 4 months since PHP 8.4 was released.

rixafy avatar Mar 23 '25 23:03 rixafy

Is anyone using any alternative library? This one seems abandoned.

simPod avatar Oct 29 '25 20:10 simPod