Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
aa34e8b
fix version string
eli-darkly Jul 16, 2018
6a08f47
Merge pull request #26 from launchdarkly/3.2.1
eli-darkly Jul 16, 2018
0d4fc33
add new version of allFlags() that captures more metadata
eli-darkly Aug 20, 2018
0f76969
linter
eli-darkly Aug 20, 2018
9023ea6
missing array key guard
eli-darkly Aug 21, 2018
e215364
missing array key guards
eli-darkly Aug 21, 2018
30e9e3c
use the standard method for specifying custom JSON serialization
eli-darkly Aug 21, 2018
775f0a1
indents
eli-darkly Aug 21, 2018
c1ac079
Merge pull request #27 from launchdarkly/eb/ch22308/all-flags-state
eli-darkly Aug 21, 2018
2f80b4c
add ability to filter for client-side flags only
eli-darkly Aug 21, 2018
fd08375
fix test to fill in all required flag fields
eli-darkly Aug 21, 2018
42c1ff2
Merge pull request #28 from launchdarkly/eb/ch12124/client-side-filter
eli-darkly Aug 22, 2018
2e9829c
implement evaluation with explanations
eli-darkly Aug 24, 2018
5d8e2b0
add another evaluation test
eli-darkly Aug 24, 2018
1977097
linter
eli-darkly Aug 24, 2018
54759db
fix test method
eli-darkly Aug 25, 2018
5038b0d
Merge branch 'master' of github.com:launchdarkly/php-client
eli-darkly Aug 25, 2018
87417f1
Merge branch 'master' of github.com:launchdarkly/php-client
eli-darkly Aug 27, 2018
07eb1a7
Merge branch 'explanation' into eb/ch19976/explanations
eli-darkly Aug 29, 2018
39d5105
fix for ch22995 - include prereq value in event even if prereq is off
eli-darkly Aug 29, 2018
8391618
Merge pull request #29 from launchdarkly/eb/ch19976/explanations
eli-darkly Sep 4, 2018
180679f
cache flag data in allFlags
eli-darkly Sep 24, 2018
15720d0
rm unused imports
eli-darkly Sep 24, 2018
dd7f268
Merge pull request #30 from launchdarkly/eb/ch24369/all-flags-caching
eli-darkly Sep 25, 2018
08572c9
Merge branch 'master' of github.com:launchdarkly/php-client
eli-darkly Sep 25, 2018
d3c3932
Merge branch 'master' of github.com:launchdarkly/php-client
eli-darkly Sep 26, 2018
a2598c7
add option to reduce front-end metadata for untracked flags
eli-darkly Oct 5, 2018
78ed55f
Merge pull request #31 from launchdarkly/eb/ch24449/less-metadata
eli-darkly Nov 8, 2018
440a2ad
Merge branch 'master' of github.com:launchdarkly/php-client
eli-darkly Nov 21, 2018
7543cf3
Merge branch 'master' of github.com:launchdarkly/php-client
eli-darkly Nov 26, 2018
37e7eaf
add ability to load flags from a file
eli-darkly Jan 10, 2019
4b2f9ef
linter
eli-darkly Jan 10, 2019
226fd95
data completeness
eli-darkly Jan 10, 2019
e997d9f
more data fixes
eli-darkly Jan 10, 2019
804a170
more data fixes
eli-darkly Jan 10, 2019
5f74cb2
more data fixes
eli-darkly Jan 10, 2019
4587c04
readme link
eli-darkly Jan 10, 2019
4ae2bd9
rm unused parameters
eli-darkly Jan 10, 2019
529ec43
fix incorrect doc comment
eli-darkly Jan 10, 2019
96dc0b4
add DynamoDB integration
eli-darkly Jan 23, 2019
ea3268e
fix test config
eli-darkly Jan 23, 2019
5da57f3
fix string check
eli-darkly Jan 23, 2019
aa62488
readme
eli-darkly Jan 23, 2019
d8bcfbb
fix test data
eli-darkly Jan 23, 2019
895aa33
factor out base class, implement caching, make configuration simpler
eli-darkly Jan 23, 2019
10662d5
fix comment
eli-darkly Jan 23, 2019
2ee0e9e
rm unused const
eli-darkly Jan 23, 2019
1eeb153
can't scope constants
eli-darkly Jan 23, 2019
c82b7c7
linter
eli-darkly Jan 23, 2019
6aead62
add Consul integration
eli-darkly Jan 23, 2019
3887732
typo
eli-darkly Jan 24, 2019
10e0daf
regenerate lockfile using PHP 5.5
eli-darkly Jan 24, 2019
2ea5c52
Merge pull request #32 from launchdarkly/eb/ch26319/file-data-source
eli-darkly Jan 24, 2019
200229c
we need at least version 2.1 of the Consul package
eli-darkly Jan 24, 2019
1a7cd19
update lockfile
eli-darkly Jan 24, 2019
d2461d2
Merge branch 'master' into eb/ch28330/dynamodb
eli-darkly Jan 24, 2019
dd92f7f
Merge branch 'eb/ch28330/dynamodb' into eb/ch28432/consul
eli-darkly Jan 24, 2019
313a473
rm comment
eli-darkly Jan 24, 2019
2580f6f
remove lockfile
eli-darkly Jan 24, 2019
72f0ac8
add delay for creating test table
eli-darkly Jan 24, 2019
546bc1c
Merge branch 'eb/ch28330/dynamodb' into eb/ch28432/consul
eli-darkly Jan 24, 2019
fd536a5
move feature requester code into Integrations namespace
eli-darkly Jan 24, 2019
a8c1647
linter
eli-darkly Jan 24, 2019
f192e9a
misc test fixes
eli-darkly Jan 24, 2019
d1a2e41
Merge pull request #35 from launchdarkly/eb/ch30532/lockfile
eli-darkly Jan 25, 2019
c7f98fd
fix apc/apcu calls
eli-darkly Jan 25, 2019
9ff5c89
Merge branch 'master' into eb/ch28330/dynamodb
eli-darkly Jan 25, 2019
088aef2
Merge pull request #33 from launchdarkly/eb/ch28330/dynamodb
eli-darkly Jan 25, 2019
6f05a0f
Merge branch 'master' into eb/ch28432/consul
eli-darkly Jan 25, 2019
a49b3c1
fix comment
eli-darkly Jan 25, 2019
22498a0
Merge branch 'eb/ch28432/consul' into eb/ch30533/feature-requesters
eli-darkly Jan 25, 2019
24cf9e0
fix deprecated caching store classes
eli-darkly Jan 25, 2019
a9100fc
better caching abstraction
eli-darkly Jan 25, 2019
80a653b
typo
eli-darkly Jan 25, 2019
47c1bc2
linter
eli-darkly Jan 25, 2019
f6cf050
fix namespaces
eli-darkly Jan 25, 2019
55dd858
fix tests
eli-darkly Jan 25, 2019
17cca84
Merge pull request #36 from launchdarkly/eb/ch28432/consul
eli-darkly Jan 25, 2019
528fc91
doc fixes
eli-darkly Jan 25, 2019
68c81fb
move a bunch more stuff
eli-darkly Jan 26, 2019
613f881
misc cleanup
eli-darkly Jan 26, 2019
6d37fdd
add test for not having any flags
eli-darkly Jan 26, 2019
4014e19
restore documentation for deprecated properties
eli-darkly Jan 31, 2019
15b780d
Merge pull request #37 from launchdarkly/eb/ch30533/feature-requesters
eli-darkly Jan 31, 2019
86bc30f
version 3.5.0
eli-darkly Jan 31, 2019
5d092f0
Merge branch 'master' of github.com:launchdarkly/php-client
eli-darkly Feb 6, 2019
9c589d1
revert accidental commit
eli-darkly Feb 27, 2019
9368bc9
add experimentation event overrides for rules and fallthrough
eli-darkly Feb 27, 2019
f669e37
linter
eli-darkly Feb 27, 2019
b88c7ee
misc fixes
eli-darkly Feb 27, 2019
1f18eb0
misc test fixes
eli-darkly Feb 27, 2019
1dc3408
Merge pull request #38 from launchdarkly/eb/ch32307/experiment
eli-darkly Mar 2, 2019
f533573
Merge commit 'b34a45325c615db18fde2038ea3e627e9d6d80ff'
eli-darkly Mar 13, 2019
87dadb3
Hr/ch34492/waitonconsul (#39)
hroederld Mar 26, 2019
30f10c8
coerce user attributes to strings when necessary, don't send events w…
eli-darkly Apr 2, 2019
2d3120b
explanatory comments
eli-darkly Apr 3, 2019
1f6cd8b
Merge pull request #40 from launchdarkly/eb/ch35189-35206/stringify-a…
eli-darkly Apr 3, 2019
f2783b3
Merge branch 'master' of github.com:launchdarkly/php-client
eli-darkly Apr 3, 2019
6d5ed05
add release script (version update only)
eli-darkly Apr 11, 2019
aa94ab4
Merge pull request #41 from launchdarkly/eb/ch36538/release-script
eli-darkly Apr 11, 2019
aa29430
use newer readme footer format
eli-darkly Apr 11, 2019
4199948
merge from public after release
LaunchDarklyCI Apr 12, 2019
8aa23ea
Merge branch 'master' into experiment
eli-darkly Apr 14, 2019
5055032
support metric value in track()
eli-darkly Apr 14, 2019
685cb1b
linter
eli-darkly Apr 15, 2019
c145908
update method description
eli-darkly Apr 17, 2019
0820f04
Merge pull request #42 from launchdarkly/eb/ch32307/metric-value
eli-darkly Apr 17, 2019
3e46f1a
add param to skip db tests, update docs for new repo name
eli-darkly Apr 25, 2019
ff1a19d
wrong method name
eli-darkly Apr 25, 2019
999660a
Merge pull request #43 from launchdarkly/eb/ch37610/allow-skip-db-tests
eli-darkly Apr 25, 2019
f224cfc
Merge branch 'master' of github.com:launchdarkly/php-client
eli-darkly Apr 25, 2019
86eefb3
add tests for rollout calculations, + misc test cleanup
eli-darkly Apr 25, 2019
a736ec4
Merge pull request #44 from launchdarkly/eb/ch37607-ch37636/rollout-t…
eli-darkly Apr 26, 2019
0e212b7
misc doc fixes
eli-darkly Apr 26, 2019
9b99cd7
misc doc fixes
eli-darkly Apr 26, 2019
605190a
merge from public after release
LaunchDarklyCI Apr 26, 2019
cf33efa
Merge branch 'master' into experiment
eli-darkly Apr 26, 2019
293daf6
update package name (#45)
bwoskow-ld May 10, 2019
2d34750
Merge branch 'master' of github.com:launchdarkly/php-server-sdk
bwoskow-ld May 10, 2019
94b4bb7
Merge branch 'master' of github.com:launchdarkly/php-client
eli-darkly Jun 3, 2019
5789708
add test for cached get all
eli-darkly Jun 4, 2019
377fc6c
typo
eli-darkly Jun 4, 2019
1d5af00
revert bugfix to test the test
eli-darkly Jun 4, 2019
d9ea2d7
reinstate bugfix
eli-darkly Jun 5, 2019
ad3608d
mix fixes, rename file
eli-darkly Jun 5, 2019
ec2337e
fix filename
eli-darkly Jun 5, 2019
91c3934
misc cleanup
eli-darkly Jun 5, 2019
79fc686
linter
eli-darkly Jun 5, 2019
151e1d8
misc fixes
eli-darkly Jun 5, 2019
632fd55
test state cleanup
eli-darkly Jun 5, 2019
32e4dc6
linter + fix filename in instructions
eli-darkly Jun 6, 2019
996efd7
Merge pull request #46 from launchdarkly/eb/ch40109/better-cache-tests
eli-darkly Jun 6, 2019
09ee165
merge from public after release
LaunchDarklyCI Jun 6, 2019
6c13435
Merge branch 'master' of github.com:launchdarkly/php-server-sdk
eli-darkly Aug 28, 2019
f029273
Merge branch 'master' into experiment
eli-darkly Oct 1, 2019
86eb407
merge from public after release
LaunchDarklyCI Oct 1, 2019
6c28767
Merge branch 'master' of github.com:launchdarkly/php-server-sdk
bwoskow-ld Nov 7, 2019
f7bdd98
Merge branch 'master' of github.com:launchdarkly/php-server-sdk-private
bwoskow-ld Nov 7, 2019
37e069b
Merge branch 'master' of github.com:launchdarkly/php-server-sdk
eli-darkly Dec 13, 2019
b90e0f7
misc CI fixes, don't try to install phpredis in 5.6
eli-darkly Dec 13, 2019
6d67a40
merge from public after release
LaunchDarklyCI Dec 13, 2019
79a19cd
don't let user fall outside of last bucket in rollout
eli-darkly Dec 30, 2019
5b21425
PHP 5.5 requires even null properties to be defined
eli-darkly Dec 30, 2019
e6c0e97
Merge branch 'master' of github.com:launchdarkly/php-server-sdk
eli-darkly Jan 1, 2020
679e5ca
minor cleanup
eli-darkly Jan 3, 2020
683872f
Merge pull request #47 from launchdarkly/eb/ch43307/bucketing-fix
eli-darkly Jan 3, 2020
73722c2
merge from public after release
LaunchDarklyCI Jan 3, 2020
620adc3
more accurate changelog text regarding phpredis
eli-darkly Jan 6, 2020
4c71745
Merge pull request #48 from launchdarkly/eb/ch60221/phpredis-changelog
eli-darkly Jan 6, 2020
8939cb2
Add circle jobs for newer PHP versions.
gwhelanLD Jan 25, 2020
9c1eadb
Revert "Add circle jobs for newer PHP versions."
gwhelanLD Jan 25, 2020
fa8a295
implement doc generation with phpDocumentor 3 (prerelease), clean up …
eli-darkly Feb 11, 2020
4d9bd1c
Add CI jobs for PHP 7.3 + 7.4 (#51)
eli-darkly Feb 13, 2020
a625518
Merge branch 'master' of github.com:launchdarkly/php-server-sdk
eli-darkly Feb 24, 2020
8393c67
Merge branch 'master' of github.com:launchdarkly/php-server-sdk
eli-darkly Apr 24, 2020
e3bcf27
ensure events aren't sent if send_events is false
eli-darkly Apr 24, 2020
364dff2
clarify test with comment
eli-darkly Apr 24, 2020
7d3bc59
Merge pull request #52 from launchdarkly/eb/ch74871/dont-send-events
eli-darkly Apr 24, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,27 @@ workflows:
name: PHP 5.5
- test-with-preinstalled-php:
name: PHP 5.6
docker-image: circleci/php:5.6.34-cli-jessie
docker-image: circleci/php:5.6
use-phpredis: false
- test-with-preinstalled-php:
name: PHP 7.0
docker-image: circleci/php:7.0.28-cli-jessie
docker-image: circleci/php:7.0
- test-with-preinstalled-php:
name: PHP 7.1
docker-image: circleci/php:7.1.15-cli-jessie
docker-image: circleci/php:7.1
- test-with-preinstalled-php:
name: PHP 7.2
docker-image: circleci/php:7.2.3-cli-stretch
docker-image: circleci/php:7.2
include-lowest-compatible-versions-test: false
# lowest "compatible" version of phpunit in 7.2 has a bug - https://github.com/sebastianbergmann/comparator/pull/30
- test-with-preinstalled-php:
name: PHP 7.3
docker-image: circleci/php:7.3
include-lowest-compatible-versions-test: false
- test-with-preinstalled-php:
name: PHP 7.4
docker-image: circleci/php:7.4
include-lowest-compatible-versions-test: false
- integration-test

jobs:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ composer.phar
.vagrant
integration-tests/vendor
composer.lock
docs/build
6 changes: 6 additions & 0 deletions .ldrelease/build-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

set -e

cd docs
make PHPDOC_ARCHIVE=/home/circleci/ldtools/phpDocumentor.phar # provided in ldcircleci/ld-php-sdk-release image
7 changes: 7 additions & 0 deletions .ldrelease/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,12 @@ publications:
- url: https://packagist.org/packages/launchdarkly/server-sdk
description: Packagist

circleCI:
linux:
image: ldcircleci/ld-php-sdk-release:1 # built in sdks-ci-docker project, contains PHP 7.2 + phpDocumentor

documentation:
githubPages: true

sdk:
displayName: "PHP"
12 changes: 12 additions & 0 deletions .ldrelease/publish-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -e

# Releaser will publish the docs to GitHub pages for us if we put a "docs.zip" artifact in ./artifacts

mkdir -p artifacts
pushd docs/build/html
rm -f docs.zip
zip -r docs.zip *
popd
mv docs/build/html/docs.zip artifacts
2 changes: 2 additions & 0 deletions .ldrelease/update-version.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -e

# Update version in LDClient class
LDCLIENT_PHP=src/LaunchDarkly/LDClient.php
LDCLIENT_PHP_TEMP=${LDCLIENT_PHP}.tmp
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ All notable changes to the LaunchDarkly PHP SDK will be documented in this file.

## [3.7.0] - 2019-12-13
### Added:
- Added integration with the [`phpredis`](https://github.com/phpredis/phpredis) extension, which supports persistent Redis connections unlike the existing `predis` integration. See `LaunchDarkly::Integrations::PHPRedis`. (Thanks, [nicofff](https://github.com/launchdarkly/php-server-sdk/pull/128)!)
- Added integration with the [`phpredis`](https://github.com/phpredis/phpredis) extension, which has similar functionality to the already-supported `predis` but may have better performance (since `predis` is written in pure PHP, whereas `phpredis` uses a C extension). See `LaunchDarkly::Integrations::PHPRedis`. (Thanks, [nicofff](https://github.com/launchdarkly/php-server-sdk/pull/128)!)

## [3.6.0] - 2019-10-01
### Added:
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
},
"require-dev": {
"aws/aws-sdk-php": "^3.86",
"friendsofphp/php-cs-fixer": "~2.2.19",
"friendsofphp/php-cs-fixer": ">=2.2.19 <3.0",
"guzzlehttp/guzzle": "^6.2.1",
"kevinrob/guzzle-cache-middleware": "^1.4.1",
"phpdocumentor/phpdocumentor": "^2.0",
"phpunit/phpunit": ">=4.8.26 <5.4",
"predis/predis": "^1.0",
"sensiolabs/consul-php-sdk": ">=2.1 <3.0",
Expand Down
17 changes: 17 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

# PHPDOC_ARCHIVE is overridden in the CircleCI release
PHPDOC_ARCHIVE := $(shell pwd)/build/phpDocumentor.phar
OUTPUT_DIR := $(shell pwd)/build
PHPDOC_URL=https://www.phpdoc.org/phpDocumentor.phar

.PHONY: install html

html: install
rm -rf build/temp build/html
cd .. && php $(PHPDOC_ARCHIVE) --visibility public --title "LaunchDarkly PHP SDK ${LD_RELEASE_VERSION}"

install: $(PHPDOC_ARCHIVE)

$(PHPDOC_ARCHIVE):
mkdir -p build
cd build && unzip ../lib/phpDocumentor.phar.zip
40 changes: 40 additions & 0 deletions phpdoc.dist.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8" ?>
<phpdoc>
<parser>
<target>docs/build/temp</target>
</parser>
<transformer>
<target>docs/build/html</target>
</transformer>
<files>
<directory>src</directory>
<ignore>src/LaunchDarkly/Impl/*</ignore>
<ignore>src/LaunchDarkly/Impl/Integrations/*</ignore>
<!-- the @ignore and @internal tags currently not working correctly in phpDocumentor, so we will manually ignore these internal files: -->
<ignore>src/LaunchDarkly/Clause.php</ignore>
<ignore>src/LaunchDarkly/EvalResult.php</ignore>
<ignore>src/LaunchDarkly/EvaluationException.php</ignore>
<ignore>src/LaunchDarkly/EventProcessor.php</ignore>
<ignore>src/LaunchDarkly/EventSerializer.php</ignore>
<ignore>src/LaunchDarkly/FeatureFlag.php</ignore>
<ignore>src/LaunchDarkly/Operators.php</ignore>
<ignore>src/LaunchDarkly/PreloadedFeatureRequester.php</ignore>
<ignore>src/LaunchDarkly/Prerequisite.php</ignore>
<ignore>src/LaunchDarkly/Rollout.php</ignore>
<ignore>src/LaunchDarkly/Rule.php</ignore>
<ignore>src/LaunchDarkly/Segment.php</ignore>
<ignore>src/LaunchDarkly/SegmentRule.php</ignore>
<ignore>src/LaunchDarkly/SemanticVersion.php</ignore>
<ignore>src/LaunchDarkly/Target.php</ignore>
<ignore>src/LaunchDarkly/UnrecoverableHTTPStatusException.php</ignore>
<ignore>src/LaunchDarkly/Util.php</ignore>
<ignore>src/LaunchDarkly/VariationOrRollout.php</ignore>
<ignore>src/LaunchDarkly/WeightedVariation.php</ignore>
</files>
<transformations>
<template name="clean"/>
</transformations>
<title>
LaunchDarkly PHP SDK
</title>
</phpdoc>
11 changes: 5 additions & 6 deletions src/LaunchDarkly/ApcLDDFeatureRequester.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
use LaunchDarkly\Impl\Integrations\RedisFeatureRequester;

/**
* Deprecated feature requester from an LDD-populated Redis, with APC caching.
* Deprecated integration class for reading flags from a Redis database, with APC caching.
*
* @deprecated Per the docs (http://php.net/manual/en/intro.apc.php):
* "This extension (APC) is considered unmaintained and dead".
* The APC extension (http://php.net/manual/en/intro.apc.php) is no longer maintained and has been
* replaced by APCu. The new Redis integration which uses APCu caching is
* {@link \LaunchDarkly\Integrations\Redis::featureRequester()}.
*
* Install APCu and use {@link \LaunchDarkly\Integrations\Redis::featureRequester()} instead!
*
* @package LaunchDarkly
* @deprecated use Redis::featureRequester()
*/
class ApcLDDFeatureRequester extends RedisFeatureRequester
{
Expand Down
4 changes: 1 addition & 3 deletions src/LaunchDarkly/ApcuLDDFeatureRequester.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@
use LaunchDarkly\Impl\Integrations\RedisFeatureRequester;

/**
* Feature requester from an LDD-populated redis, with APCu caching.
* Deprecated integration class for reading flags from a Redis database, with APCu caching.
*
* Unlike APC, APCu is actively maintained and is available from php53 to php7.
*
* This class is deprecated. Use {@link \LaunchDarkly\Integrations\Redis::featureRequester()}
* and set the `apc_expiration` option.
*
* @deprecated Use {@link \LaunchDarkly\Integrations\Redis::featureRequester()} and set the `apc_expiration` option.
*
* @package LaunchDarkly
*/
class ApcuLDDFeatureRequester extends RedisFeatureRequester
{
Expand Down
8 changes: 8 additions & 0 deletions src/LaunchDarkly/Clause.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

namespace LaunchDarkly;

/**
* Internal data model class that describes a clause within a feature flag rule or segment rule.
*
* Application code should never need to reference the data model directly.
*
* @ignore
* @internal
*/
class Clause
{
/** @var string */
Expand Down
6 changes: 6 additions & 0 deletions src/LaunchDarkly/EvalResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

namespace LaunchDarkly;

/**
* Internal class that holds intermediate flag evaluation results.
*
* @ignore
* @internal
*/
class EvalResult
{
/** @var EvaluationDetail */
Expand Down
5 changes: 3 additions & 2 deletions src/LaunchDarkly/EvaluationDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace LaunchDarkly;

/**
* An object returned by LDClient.variationDetail(), combining the result of a flag evaluation with
* an explanation of how it was calculated.
* An object that combines the result of a flag evaluation with an explanation of how it was calculated.
*
* This is returned by {@link \LaunchDarkly\LDClient::variationDetail()}.
*/
class EvaluationDetail
{
Expand Down
7 changes: 7 additions & 0 deletions src/LaunchDarkly/EvaluationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@

use Exception;

/**
* Obsolete internal exception class, no longer used. Will be removed in a future version.
*
* @deprecated
* @ignore
* @internal
*/
class EvaluationException extends Exception
{
/**
Expand Down
22 changes: 20 additions & 2 deletions src/LaunchDarkly/EvaluationReason.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,69 +3,81 @@
namespace LaunchDarkly;

/**
* Describes the reason that a flag evaluation produced a particular value. This is part of
* the EvaluationDetail object returned by LDClient.variationDetail().
* Describes the reason that a flag evaluation produced a particular value.
*
* This is part of the {@link \LaunchDarkly\EvaluationDetail} object returned by {@link \LaunchDarkly\LDClient::variationDetail()}.
*/
class EvaluationReason implements \JsonSerializable
{
/**
* A possible value for getKind(): indicates that the flag was off and therefore returned
* its configured off value.
* @var string
*/
const OFF = 'OFF';
/**
* A possible value for getKind(): indicates that the flag was on but the user did not
* match any targets or rules.
* @var string
*/
const FALLTHROUGH = 'FALLTHROUGH';
/**
* A possible value for getKind(): indicates that the user key was specifically targeted
* for this flag.
* @var string
*/
const TARGET_MATCH = 'TARGET_MATCH';
/**
* A possible value for getKind(): indicates that the user matched one of the flag's rules.
* @var string
*/
const RULE_MATCH = 'RULE_MATCH';
/**
* A possible value for getKind(): indicates that the flag was considered off because it
* had at least one prerequisite flag that either was off or did not return the desired variation.
* @var string
*/
const PREREQUISITE_FAILED = 'PREREQUISITE_FAILED';
/**
* A possible value for getKind(): indicates that the flag could not be evaluated, e.g.
* because it does not exist or due to an unexpected error.
* @var string
*/
const ERROR = 'ERROR';

/**
* A possible value for getErrorKind(): indicates that the caller tried to evaluate a flag
* before the client had successfully initialized.
* @var string
*/
const CLIENT_NOT_READY_ERROR = 'CLIENT_NOT_READY';

/**
* A possible value for getErrorKind(): indicates that the caller provided a flag key that
* did not match any known flag.
* @var string
*/
const FLAG_NOT_FOUND_ERROR = 'FLAG_NOT_FOUND';

/**
* A possible value for getErrorKind(): indicates that there was an internal inconsistency
* in the flag data, e.g. a rule specified a nonexistent variation. An error message will
* always be logged in this case.
* @var string
*/
const MALFORMED_FLAG_ERROR = 'MALFORMED_FLAG';

/**
* A possible value for getErrorKind(): indicates that the caller passed null for the user
* parameter, or the user lacked a key.
* @var string
*/
const USER_NOT_SPECIFIED_ERROR = 'USER_NOT_SPECIFIED';

/**
* A possible value for getErrorKind(): indicates that an unexpected exception stopped flag
* evaluation.
* @var string
*/
const EXCEPTION_ERROR = 'EXCEPTION';

Expand All @@ -77,6 +89,7 @@ class EvaluationReason implements \JsonSerializable

/**
* Creates a new instance of the OFF reason.
* @return EvaluationReason
*/
public static function off()
{
Expand All @@ -85,6 +98,7 @@ public static function off()

/**
* Creates a new instance of the FALLTHROUGH reason.
* @return EvaluationReason
*/
public static function fallthrough()
{
Expand All @@ -93,6 +107,7 @@ public static function fallthrough()

/**
* Creates a new instance of the TARGET_MATCH reason.
* @return EvaluationReason
*/
public static function targetMatch()
{
Expand All @@ -101,6 +116,7 @@ public static function targetMatch()

/**
* Creates a new instance of the RULE_MATCH reason.
* @return EvaluationReason
*/
public static function ruleMatch($ruleIndex, $ruleId)
{
Expand All @@ -109,6 +125,7 @@ public static function ruleMatch($ruleIndex, $ruleId)

/**
* Creates a new instance of the PREREQUISITE_FAILED reason.
* @return EvaluationReason
*/
public static function prerequisiteFailed($prerequisiteKey)
{
Expand All @@ -117,6 +134,7 @@ public static function prerequisiteFailed($prerequisiteKey)

/**
* Creates a new instance of the ERROR reason.
* @return EvaluationReason
*/
public static function error($errorKind)
{
Expand Down
3 changes: 3 additions & 0 deletions src/LaunchDarkly/EventProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
use LaunchDarkly\Integrations\Curl;

/**
* Internal class that processes analytics event data.
*
* @ignore
* @internal
*/
class EventProcessor
Expand Down
Loading