Skip to content

Commit a0f25e1

Browse files
committed
chore: Inline shared test package
1 parent 1bc4e43 commit a0f25e1

File tree

9 files changed

+317
-50
lines changed

9 files changed

+317
-50
lines changed

.github/actions/ci/action.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ inputs:
1010
type: boolean
1111
required: false
1212
default: false
13-
shared-test-version:
14-
description: 'Which version of the shared test package should we required'
15-
required: false
16-
default: 4.x-dev
1713
token:
1814
description: 'Token used to prevent composer rate limiting'
1915
required: true
@@ -33,10 +29,6 @@ runs:
3329
shell: bash
3430
run: composer install --no-progress
3531

36-
- name: Require appropriate shared tests package
37-
shell: bash
38-
run: composer require --dev 'launchdarkly/server-sdk-shared-tests:${{ inputs.shared-test-version }}'
39-
4032
- name: Downgrade to lowest versions
4133
if: ${{ inputs.use-lowest-dependencies }}
4234
shell: bash

.github/workflows/ci.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,14 @@ jobs:
2323
fail-fast: false
2424
matrix:
2525
include:
26-
# 8.1 configurations
2726
- php-version: 8.1
2827
use-lowest-dependencies: true
29-
shared-test-version: 5.x-dev
30-
- php-version: 8.1
31-
use-lowest-dependencies: true
32-
shared-test-version: dev-main
3328

34-
# 8.2 configurations
35-
- php-version: 8.2
36-
use-lowest-dependencies: false
37-
shared-test-version: 5.x-dev
3829
- php-version: 8.2
3930
use-lowest-dependencies: false
40-
shared-test-version: dev-main
4131

42-
# 8.3 configurations
43-
- php-version: 8.3
44-
use-lowest-dependencies: false
45-
shared-test-version: 5.x-dev
4632
- php-version: 8.3
4733
use-lowest-dependencies: false
48-
shared-test-version: dev-main
4934

5035
steps:
5136
- uses: actions/checkout@v4
@@ -56,5 +41,4 @@ jobs:
5641
with:
5742
php-version: ${{ matrix.php-version }}
5843
use-lowest-dependencies: ${{ matrix.use-lowest-dependencies }}
59-
shared-test-version: ${{ matrix.shared-test-version }}
6044
token: ${{ secrets.GITHUB_TOKEN }}

composer.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
{
2-
"repositories": [
3-
{
4-
"type": "vcs",
5-
"url": "https://github.com/launchdarkly/php-server-sdk-shared-tests"
6-
}
7-
],
82
"name": "launchdarkly/server-sdk-redis-phpredis",
93
"description": "LaunchDarkly PHP SDK Redis integration using the phpredis extension",
104
"keywords": [

src/LaunchDarkly/Impl/Integrations/BigSegmentStore.php renamed to src/LaunchDarkly/Impl/Integrations/BigSegmentsStore.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
use Redis;
1313

1414
/**
15-
* Internal implementation of the php-redis BigSegmentStore interface.
15+
* Internal implementation of the php-redis BigSegmentsStore interface.
1616
*/
17-
class BigSegmentStore implements Subsystems\BigSegmentStore
17+
class BigSegmentsStore implements Subsystems\BigSegmentsStore
1818
{
1919
private const string KEY_LAST_UP_TO_DATE = ':big_segments_synchronized_on';
2020
private const string KEY_CONTEXT_INCLUDE = ':big_segment_include:';
@@ -35,14 +35,14 @@ public function __construct(
3535
$this->prefix = $options['prefix'] ?? Integrations\PHPRedis::DEFAULT_PREFIX;
3636
}
3737

38-
public function getMetadata(): Types\BigSegmentStoreMetadata
38+
public function getMetadata(): Types\BigSegmentsStoreMetadata
3939
{
4040
try {
4141
/** @var string|false */
4242
$lastUpToDate = $this->connection->get($this->prefix . self::KEY_LAST_UP_TO_DATE);
4343
} catch (Exception $e) {
4444
$this->logger->warning('Error getting last-up-to-date time from Redis', ['exception' => $e->getMessage()]);
45-
return new Types\BigSegmentStoreMetadata(lastUpToDate: null);
45+
return new Types\BigSegmentsStoreMetadata(lastUpToDate: null);
4646
}
4747

4848
if ($lastUpToDate === false) {
@@ -51,7 +51,7 @@ public function getMetadata(): Types\BigSegmentStoreMetadata
5151
$lastUpToDate = (int)$lastUpToDate;
5252
}
5353

54-
return new Types\BigSegmentStoreMetadata(lastUpToDate: $lastUpToDate);
54+
return new Types\BigSegmentsStoreMetadata(lastUpToDate: $lastUpToDate);
5555
}
5656

5757
public function getMembership(string $contextHash): ?array
@@ -62,7 +62,7 @@ public function getMembership(string $contextHash): ?array
6262
/** @var array<string> */
6363
$excludeRefs = $this->connection->sMembers($this->prefix . self::KEY_CONTEXT_EXCLUDE . $contextHash);
6464
} catch (Exception $e) {
65-
$this->logger->warning('Error getting big segment membership from Redis', ['exception' => $e->getMessage()]);
65+
$this->logger->warning('Error getting big segments membership from Redis', ['exception' => $e->getMessage()]);
6666
return null;
6767
}
6868

src/LaunchDarkly/Integrations/PHPRedis.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@ public static function featureRequester($options = [])
5252
/**
5353
* @param array<string,mixed> $options
5454
* - `prefix`: namespace prefix to add to all hash keys
55-
* @return callable(LoggerInterface, array): Subsystems\BigSegmentStore
55+
* @return callable(LoggerInterface, array): Subsystems\BigSegmentsStore
5656
*/
57-
public static function bigSegmentStore(Redis $client, array $options = []): callable
57+
public static function bigSegmentsStore(Redis $client, array $options = []): callable
5858
{
5959
if (!extension_loaded('redis')) {
6060
throw new \RuntimeException("phpredis extension is required to use Integrations\\PHPRedis");
6161
}
6262

63-
return function (LoggerInterface $logger, array $baseOptions) use ($client, $options): Subsystems\BigSegmentStore {
64-
return new Integrations\BigSegmentStore($client, $logger, array_merge($baseOptions, $options));
63+
return function (LoggerInterface $logger, array $baseOptions) use ($client, $options): Subsystems\BigSegmentsStore {
64+
return new Integrations\BigSegmentsStore($client, $logger, array_merge($baseOptions, $options));
6565
};
6666
}
6767
}

0 commit comments

Comments
 (0)