From fd085e374be5a132d6b4c87ea096815074f94b05 Mon Sep 17 00:00:00 2001 From: jsonbailey Date: Mon, 20 Oct 2025 20:17:22 +0000 Subject: [PATCH 1/6] chore: Add latest versions of PHP to CI --- .github/workflows/ci.yml | 4 ++-- composer.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf0831da..77c70af3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: [8.1, 8.2] + php-version: [8.1, 8.2, 8.3, 8.4] use-lowest-dependencies: [true, false] env: @@ -44,7 +44,7 @@ jobs: strategy: matrix: - php-version: ['8.1', '8.2'] + php-version: ['8.1', '8.2', '8.3', '8.4'] env: LD_INCLUDE_INTEGRATION_TESTS: 1 diff --git a/composer.json b/composer.json index 836c9dfa..add3f80b 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "kevinrob/guzzle-cache-middleware": "^4.0", "phpunit/php-code-coverage": "^9", "phpunit/phpunit": "^9", - "vimeo/psalm": "^5.15" + "vimeo/psalm": "^6.13.1" }, "suggest": { "guzzlehttp/guzzle": "(^6.3 | ^7) Required when using GuzzleEventPublisher or the default FeatureRequester", From f38c6706bb741824f13a63974d38c4ddd42c85b0 Mon Sep 17 00:00:00 2001 From: Matthew Keeler Date: Fri, 24 Oct 2025 16:00:34 -0400 Subject: [PATCH 2/6] fix unnecessary type annotation --- src/LaunchDarkly/LDClient.php | 2 -- src/LaunchDarkly/Migrations/Migrator.php | 4 ---- 2 files changed, 6 deletions(-) diff --git a/src/LaunchDarkly/LDClient.php b/src/LaunchDarkly/LDClient.php index 56cacdf0..a3a814ad 100644 --- a/src/LaunchDarkly/LDClient.php +++ b/src/LaunchDarkly/LDClient.php @@ -277,9 +277,7 @@ public function variationDetail(string $key, LDContext $context, mixed $defaultV public function migrationVariation(string $key, LDContext $context, Stage $defaultStage): array { $result = $this->variationDetailInternal($key, $context, $defaultStage->value, $this->_eventFactoryDefault); - /** @var EvaluationDetail $detail */ $detail = $result['detail']; - /** @var ?FeatureFlag $flag */ $flag = $result['flag']; $value = $detail->getValue(); diff --git a/src/LaunchDarkly/Migrations/Migrator.php b/src/LaunchDarkly/Migrations/Migrator.php index fde06e97..08649636 100644 --- a/src/LaunchDarkly/Migrations/Migrator.php +++ b/src/LaunchDarkly/Migrations/Migrator.php @@ -37,9 +37,7 @@ public function read( mixed $payload = null ): OperationResult { $variationResult = $this->client->migrationVariation($key, $context, $defaultStage); - /** @var Stage */ $stage = $variationResult['stage']; - /** @var OpTracker */ $tracker = $variationResult['tracker']; $tracker->operation(Operation::READ); @@ -70,9 +68,7 @@ public function write( mixed $payload = null ): WriteResult { $variationResult = $this->client->migrationVariation($key, $context, $defaultStage); - /** @var Stage */ $stage = $variationResult['stage']; - /** @var OpTracker */ $tracker = $variationResult['tracker']; $tracker->operation(Operation::WRITE); From 296c65b6692f8ddbd08fae9748ef267930beaac9 Mon Sep 17 00:00:00 2001 From: Matthew Keeler Date: Fri, 24 Oct 2025 16:04:25 -0400 Subject: [PATCH 3/6] Generate psalm baseline to faciliate version update --- psalm-baseline.xml | 616 +++++++++++++++++++++++++++++++++++++++++++++ psalm.xml | 1 + 2 files changed, 617 insertions(+) create mode 100644 psalm-baseline.xml diff --git a/psalm-baseline.xml b/psalm-baseline.xml new file mode 100644 index 00000000..015ada10 --- /dev/null +++ b/psalm-baseline.xml @@ -0,0 +1,616 @@ + + + + + + + + + + + + + + + + + + + + + + _errorKind]]> + _prerequisiteKey]]> + _ruleId]]> + _ruleIndex]]> + + + + + + + + + + + + + + + + + getDebugEventsUntilDate()]]> + getDebugEventsUntilDate()]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + getWeight() / 100000.0]]> + + + getBucketBy()]]> + getContextKind()]]> + + + + + + + + getWeight() / 100000.0]]> + + + isExperiment() ? null : $rollout->getBucketBy()]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + getDebugEventsUntilDate()]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + _send_events]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + _error]]> + + + + _attributes]]> + _error]]> + _multiContexts]]> + + + + + + + + + + + + + + + + + _kind]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + _singleComponent]]> + + + + + + + + + + + + + + + + + + + + + + diff --git a/psalm.xml b/psalm.xml index 4e9226bd..a7d49831 100644 --- a/psalm.xml +++ b/psalm.xml @@ -5,6 +5,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" + errorBaseline="psalm-baseline.xml" > From c257108c5255f6a15d9801849223f2a1f20a5836 Mon Sep 17 00:00:00 2001 From: Matthew Keeler Date: Fri, 24 Oct 2025 16:20:27 -0400 Subject: [PATCH 4/6] Remove unused class warning --- psalm-baseline.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 015ada10..bc3d379f 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -157,9 +157,6 @@ - - - From 2434b0a796b122a6920527e0390bacf6746c34ef Mon Sep 17 00:00:00 2001 From: Matthew Keeler Date: Fri, 24 Oct 2025 16:27:55 -0400 Subject: [PATCH 5/6] Bump cs-fixer --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index add3f80b..921f82b3 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "ramsey/uuid": "^4.7" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.15.0", + "friendsofphp/php-cs-fixer": "^3.80.0", "guzzlehttp/guzzle": "^7", "kevinrob/guzzle-cache-middleware": "^4.0", "phpunit/php-code-coverage": "^9", From 7f3728b6c226297dde7911e547303d14a106aca0 Mon Sep 17 00:00:00 2001 From: Matthew Keeler Date: Fri, 24 Oct 2025 16:41:22 -0400 Subject: [PATCH 6/6] disable windows fail-fast --- .github/workflows/ci.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77c70af3..1fcd4bc8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,13 +1,13 @@ name: Run CI on: push: - branches: [ main ] + branches: [main] paths-ignore: - - '**.md' # Do not need to run CI for markdown changes. + - "**.md" # Do not need to run CI for markdown changes. pull_request: - branches: [ main ] + branches: [main] paths-ignore: - - '**.md' + - "**.md" jobs: linux-build: @@ -43,8 +43,9 @@ jobs: runs-on: windows-latest strategy: + fail-fast: false matrix: - php-version: ['8.1', '8.2', '8.3', '8.4'] + php-version: ["8.1", "8.2", "8.3", "8.4"] env: LD_INCLUDE_INTEGRATION_TESTS: 1