Skip to content

Commit c48fd7f

Browse files
authored
make source layout match namespaces, use 4.0 SDK branch (#3)
1 parent 3a8c658 commit c48fd7f

File tree

5 files changed

+35
-4
lines changed

5 files changed

+35
-4
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/vendor/
2+
/doc/
3+
composer.phar
4+
.php_cs.cache
5+
composer.lock
6+
docs/build
7+
phpunit/
8+
.phpunit.result.cache

.ldrelease/config.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
publications:
2+
- url: https://packagist.org/packages/launchdarkly/server-sdk-redis-phpredis
3+
description: Packagist
4+
5+
circleci:
6+
linux:
7+
image: ldcircleci/ld-php-sdk-release:1 # built in sdks-ci-docker project, contains PHP 7.2 + phpDocumentor
8+
9+
documentation:
10+
githubPages: true

composer.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
{
2+
"repositories": [
3+
{
4+
"type": "git",
5+
"url": "https://github.com/launchdarkly/php-server-sdk-private.git"
6+
}
7+
],
28
"name": "launchdarkly/server-sdk-redis-phpredis",
39
"description": "LaunchDarkly PHP SDK Redis integration using the phpredis extension",
410
"keywords": [
@@ -15,7 +21,12 @@
1521
],
1622
"require": {
1723
"php": ">=7.3",
18-
"launchdarkly/server-sdk": "^4"
24+
"launchdarkly/server-sdk": "4.0.x-dev"
25+
},
26+
"autoload": {
27+
"psr-4": {
28+
"LaunchDarkly\\": "src/LaunchDarkly/"
29+
}
1930
},
2031
"config": {
2132
"sort-packages": true

src/PHPRedisFeatureRequester.php renamed to src/LaunchDarkly/Impl/Integrations/PHPRedisFeatureRequester.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ public function __construct($baseUri, $sdkKey, $options)
3030
}
3131
}
3232

33-
protected function readItemString($namespace, $key)
33+
protected function readItemString($namespace, $key): ?string
3434
{
3535
$redis = $this->getConnection();
3636
return $redis->hget($namespace, $key);
3737
}
3838

39-
protected function readItemStringList($namespace)
39+
protected function readItemStringList($namespace): ?array
4040
{
4141
$redis = $this->getConnection();
4242
$raw = $redis->hgetall($namespace);

src/PHPRedis.php renamed to src/LaunchDarkly/Integrations/PHPRedis.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22
namespace LaunchDarkly\Integrations;
33

4+
use LaunchDarkly\Impl\Integrations\PHPRedisFeatureRequester;
5+
46
/**
57
* Integration with a Redis data store using the `phpredis` extension.
68
*/
@@ -36,7 +38,7 @@ public static function featureRequester($options = array())
3638
}
3739

3840
return function ($baseUri, $sdkKey, $baseOptions) use ($options) {
39-
return new Impl\PHPRedisFeatureRequester($baseUri, $sdkKey, array_merge($baseOptions, $options));
41+
return new PHPRedisFeatureRequester($baseUri, $sdkKey, array_merge($baseOptions, $options));
4042
};
4143
}
4244
}

0 commit comments

Comments
 (0)