From 813a1391d85f1a8812cb987bf035e75ce5609833 Mon Sep 17 00:00:00 2001 From: Fahad Heylaal Date: Mon, 19 Oct 2026 01:39:07 +0200 Subject: [PATCH] chore: upgrade to PHP SDK v4 --- composer.json | 2 +- composer.lock | 14 +++++++------- src/index.php | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index 72ebc23..e45604d 100644 --- a/composer.json +++ b/composer.json @@ -4,6 +4,6 @@ "type": "project", "license": "MIT", "require": { - "featurevisor/featurevisor-php": "^3.0" + "featurevisor/featurevisor-php": "^4.0" } } diff --git a/composer.lock b/composer.lock index 2231d09..3def383 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "75894dbcaa0704ac1816370c9a5afc5c", + "content-hash": "e247c3ca246c82e7ec0539a01ff94745", "packages": [ { "name": "featurevisor/featurevisor-php", - "version": "v3.0.0", + "version": "v4.0.0", "source": { "type": "git", "url": "https://github.com/featurevisor/featurevisor-php.git", - "reference": "d36b58a9920f8053b82ee9cdfe8d2bb6bd3ec46c" + "reference": "45f0d3eb3134bc4c4dc268f94a64a486c12573f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/featurevisor/featurevisor-php/zipball/d36b58a9920f8053b82ee9cdfe8d2bb6bd3ec46c", - "reference": "d36b58a9920f8053b82ee9cdfe8d2bb6bd3ec46c", + "url": "https://api.github.com/repos/featurevisor/featurevisor-php/zipball/45f0d3eb3134bc4c4dc268f94a64a486c12573f6", + "reference": "45f0d3eb3134bc4c4dc268f94a64a486c12573f6", "shasum": "" }, "require": { @@ -25,7 +25,7 @@ "php": "^8.0" }, "require-dev": { - "open-feature/sdk": "^2.2", + "open-feature/sdk": "^2.3", "phpstan/phpstan": "^2.2", "phpunit/phpunit": "^9.6.33" }, @@ -66,7 +66,7 @@ "issues": "https://github.com/featurevisor/featurevisor-php/issues", "source": "https://github.com/featurevisor/featurevisor-php" }, - "time": "2026-08-29T15:22:03+00:00" + "time": "2026-10-18T22:57:08+00:00" } ], "packages-dev": [], diff --git a/src/index.php b/src/index.php index 51cc1cc..56f2bdb 100644 --- a/src/index.php +++ b/src/index.php @@ -26,9 +26,9 @@ throw new RuntimeException("Datafile request failed: {$statusLine}"); } -$datafile = json_decode($datafileJson, true, 512, JSON_THROW_ON_ERROR); +// Raw JSON keeps `{}` and `[]` distinct, which decoding into PHP arrays cannot. $f = Featurevisor::createFeaturevisor([ - 'datafile' => $datafile, + 'datafile' => $datafileJson, 'logLevel' => 'error', 'context' => [ 'userId' => 'customer-123',