Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
314 commits
Select commit Hold shift + click to select a range
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
8212888
Merge branch 'master' of github.com:launchdarkly/php-server-sdk
eli-darkly Apr 24, 2020
3f7fe2d
merge from public after release
LaunchDarklyCI Apr 24, 2020
8a3cd23
make prefix concatenation in DynamoDB consistent with other SDKs
eli-darkly Oct 27, 2020
39b0455
fix test
eli-darkly Oct 27, 2020
5e1fd6d
Merge pull request #53 from launchdarkly/eb/ch93198/dynamodb-prefix
eli-darkly Oct 28, 2020
52ccede
fix PHP 5.5 CI build by pinning Composer version (#54)
eli-darkly Oct 28, 2020
3117bfc
merge from public after release
LaunchDarklyCI Oct 28, 2020
ffea01c
Updating warning log in Identify to not say Track was called (#56)
bwoskow-ld Jan 7, 2021
4343546
merge from public after release
LaunchDarklyCI Jan 7, 2021
5817116
Removed the guides link
bwoskow-ld Feb 3, 2021
d22898b
Merge branch 'master' of github.com:launchdarkly/php-server-sdk
eli-darkly Feb 27, 2021
d03019a
merge from public after release
LaunchDarklyCI Mar 1, 2021
2bf1cba
add alias functionality and some related tests
Apr 9, 2021
51902d2
Revert "add alias functionality and some related tests"
apache-hb Apr 9, 2021
8dae41c
Merge branch 'master' of github.com:launchdarkly/php-server-sdk-private
eli-darkly Apr 14, 2021
016665c
Merge branch 'master' of github.com:launchdarkly/php-server-sdk
eli-darkly Apr 14, 2021
710b6cd
merge from public after release
LaunchDarklyCI Apr 14, 2021
ee8916f
add alias events support (#57)
apache-hb Apr 19, 2021
6deaf9b
merge from public after release
LaunchDarklyCI Apr 19, 2021
995762c
merge exp-alloc
hroederld Jun 21, 2021
b98cc50
merge from public after release
LaunchDarklyCI Jun 21, 2021
f9f17db
drop support for EOL php versions and update deps (#60)
apache-hb Jul 29, 2021
f9138f0
fix test class
eli-darkly Jul 29, 2021
37466e2
remove database integrations from SDK (#63)
eli-darkly Jul 29, 2021
53686a7
add type hints to FeatureRequesterBase methods
eli-darkly Jul 29, 2021
0e5230d
Merge branch 'master' of github.com:launchdarkly/php-server-sdk
eli-darkly Jul 30, 2021
786ab3f
fix PHPRedis logic for prefix & custom client, add unit tests (#64)
eli-darkly Jul 31, 2021
4e9330a
merge from public after release
Aug 2, 2021
511f727
add psalm lints and php hints (#62)
apache-hb Aug 3, 2021
0eacd84
remove deprecated members (#65)
eli-darkly Aug 3, 2021
2c0821e
change default base URL to sdk.launchdarkly.com
eli-darkly Aug 3, 2021
d72754b
Merge pull request #67 from launchdarkly/eb/ch114714/base-url
eli-darkly Aug 5, 2021
1095977
move non-public classes into Impl namespace (#66)
eli-darkly Aug 5, 2021
b8d539a
add CI job for PHP 8.0 (#69)
eli-darkly Aug 6, 2021
785890a
use phpDocumentor 3 + misc doc comment cleanup (#68)
eli-darkly Aug 6, 2021
2a64354
Merge branch 'master' into 4.0
eli-darkly Aug 7, 2021
148ba47
merge from public after release
Aug 7, 2021
ed29c2b
Updates docs URLs
ember-stevens Sep 24, 2021
e865744
Merge pull request #70 from launchdarkly/emberstevens/sc-118589/url-a…
ember-stevens Sep 27, 2021
72a3439
pin Psalm to 4.9.2 to prevent a spurious linting error (#71)
eli-darkly Sep 29, 2021
5f70f18
use Releaser v2 config + add badge links in readme (#72)
eli-darkly Oct 8, 2021
c3f48f2
use Releaser PHP project template (#73)
eli-darkly Oct 11, 2021
8382bc3
remove obsolete line that's no longer used because $seed is computed …
eli-darkly Oct 12, 2021
9974806
remove obsolete VERSION file
eli-darkly Oct 12, 2021
730a497
Merge pull request #76 from launchdarkly/eb/sc-126501/version-file
eli-darkly Oct 13, 2021
77b990e
Merge pull request #75 from launchdarkly/eb/sc-126500/rm-obsolete-line
eli-darkly Oct 13, 2021
d537537
Fix test confirming send_events = false is honored (#78)
keelerm84 Oct 14, 2021
a239522
Minor cleanup and consistency changes (#79)
keelerm84 Oct 20, 2021
e12ed37
Add integration test for curl event publisher (#77)
keelerm84 Oct 21, 2021
d66ae02
Curl honor connect_timeout (#81)
keelerm84 Oct 25, 2021
fa2377a
Set required connect_timeout option in test (#82)
keelerm84 Oct 25, 2021
bf54f4b
Add Windows support for "Curl" publisher (#80)
keelerm84 Oct 25, 2021
03e64d1
Add cs-check to build process (#83)
keelerm84 Oct 26, 2021
f16f39d
Don't treat numeric strings as numbers (#84)
keelerm84 Oct 28, 2021
0b34edc
Decrease psalm error level (#85)
keelerm84 Nov 19, 2021
4bca5de
added TestData, FlagBuilder; added TestDataTest; started implementing…
charukiewicz Jan 20, 2022
ce1b438
made props protected, made basic build method, made variations method…
joemalin95 Jan 20, 2022
9db1f9a
continued implementing test data and tests for test data
joemalin95 Jan 21, 2022
2ae4dff
implemented varationForAllUsers, valueForAllUsers, and variationForUs…
joemalin95 Jan 24, 2022
e51d913
reorganized functions, added needed classes and functions, left some …
joemalin95 Jan 25, 2022
d63dc75
broken - transitioning build to return a FeatureFlag, finished implem…
joemalin95 Jan 27, 2022
335e60c
reverted build to return array, implemented getFeature and getAllFeat…
joemalin95 Jan 28, 2022
e5c5c46
fixed build, implemented FeatureRequester, added simple test case
joemalin95 Jan 31, 2022
9c9da6f
Event attribute filtering is overly aggressively (#86)
keelerm84 Feb 2, 2022
dea0c92
Account for traffic allocation on all flags (#87)
keelerm84 Feb 2, 2022
8c15326
finished FlagRuleBuilder implementation; fixed psalm errors; improved…
charukiewicz Feb 4, 2022
a2f63d7
fixed php-cs-fixer warnings in TestDataTest.php
charukiewicz Feb 4, 2022
012d55a
Apply suggestions from code review
charukiewicz Feb 4, 2022
f97e86f
replace use of array_push with append operator; standardized capitali…
charukiewicz Feb 4, 2022
ff5abca
Merge branch 'cc/sc-137833/test-data-flag-builder' of github.com:laun…
charukiewicz Feb 4, 2022
7d9b84f
remove array_splice() implementation of existing user key removal due…
charukiewicz Feb 4, 2022
db09c87
converted variationForUser to use array_splice but fixed issue caused…
charukiewicz Feb 5, 2022
ad502eb
fixed missing indexes required to decode FlagBuilder into a FeatureFl…
charukiewicz Feb 7, 2022
f07d83f
split off TestData\FlagBuilder and TestData\FlagRuleBuilder from Test…
charukiewicz Feb 14, 2022
f652e8c
additional cleanup; added missing type hint; minor refactoring
charukiewicz Feb 14, 2022
2fe589c
remove special handling of singleton arrays in FlagBuilder::variations()
charukiewicz Feb 14, 2022
3199a74
run php-cs-fixer on TestData-related files
charukiewicz Feb 14, 2022
e22397f
started writing repetitive tests using the phpunit @dataProvider feature
charukiewicz Feb 14, 2022
93028a4
swapped positions of expected and actual in dataProvider-driven test
charukiewicz Feb 14, 2022
ecf6c73
fix typos in code in comment blocks
charukiewicz Feb 15, 2022
75d3ead
merge from public after release
Feb 16, 2022
d67ee8e
Apply whitespace fixes from code review
charukiewicz Feb 28, 2022
4610d95
split unwieldy tests in TestDataTest into separate tests; address TOD…
charukiewicz Feb 28, 2022
1fad3fe
added annotations to dataProvider-driven tests
charukiewicz Feb 28, 2022
2ca4390
changed _isBooleanFlag() implementation to use strict equality
charukiewicz Feb 28, 2022
0dff413
Merge pull request #88 from launchdarkly/cc/sc-137833/test-data-flag-…
charukiewicz Mar 2, 2022
4b03134
Add unit test to verify `in` operator in TestData (#89)
keelerm84 Apr 4, 2022
0ee1b5b
Add support for psr/log 2 and 3 (#91)
keelerm84 Apr 5, 2022
719d1e9
Merge pull request #90 from launchdarkly/test-data
keelerm84 Apr 11, 2022
d6b6ef5
merge from public after release
Apr 13, 2022
32991eb
Adds link to Relay Proxy docs
ember-stevens Apr 19, 2022
f84e7e9
Merge pull request #92 from launchdarkly/emberstevens/sc-150321/stand…
ember-stevens Apr 20, 2022
9c1f2e6
master -> main
keelerm84 May 6, 2022
2619541
Add support for Guzzle 6.3 (#93)
keelerm84 Jul 5, 2022
3dff005
merge from public after release
Jul 5, 2022
4097d6e
Use setVersion on update of a changed flag (#161)
aretenz Jul 28, 2022
4b0b6eb
Merge branch 'contrib' into private-main
keelerm84 Jul 28, 2022
72f8bd7
merge from public after release
Aug 1, 2022
0a7a18d
Add support for monolog 3.0 (#94)
keelerm84 Sep 6, 2022
d85c61d
merge from public after release
Sep 7, 2022
331eea8
fix base URI concatenation so path isn't lost
eli-darkly Oct 4, 2022
f083261
fix JSON output for empty allFlagsState result
eli-darkly Oct 4, 2022
e7857d2
lint
eli-darkly Oct 4, 2022
c01cf6e
also fix base URIs for events
eli-darkly Oct 4, 2022
e338c69
Merge branch 'eb/sc-139580/empty-flags-state-json' into contract-tests
eli-darkly Oct 4, 2022
ee95057
fix JSON output for empty allFlagsState result (#97)
eli-darkly Oct 4, 2022
08f842a
fix base URI concatenation so path isn't lost (#96)
eli-darkly Oct 4, 2022
eddb393
Merge branch 'main' into contract-tests
eli-darkly Oct 4, 2022
edadb02
disallow non-strings in semver comparisons (#98)
eli-darkly Oct 4, 2022
113969e
implement contract test service (#95)
eli-darkly Oct 4, 2022
7ca3e4b
Merge branch 'contract-tests' into 5.0
eli-darkly Oct 4, 2022
d1514c5
(5.0) fix date parsing to disallow invalid types and formats (#99)
eli-darkly Oct 5, 2022
d9af33f
change test service to not require Docker, enable tests in CI (#100)
eli-darkly Oct 6, 2022
c35a830
merge from public after release
Oct 7, 2022
1f9bd2f
Merge branch 'main' into 5.0
eli-darkly Oct 7, 2022
c7a8581
remove alias events (#101)
eli-darkly Oct 10, 2022
093a4c4
(U2C #1) implement context type (without attribute references) (#102)
eli-darkly Oct 12, 2022
32ded83
(U2C #2) basic changes to use contexts in evaluations instead of user…
eli-darkly Oct 12, 2022
116a6c6
(U2C #3) update CI, release configuration, and dev dependencies for m…
eli-darkly Oct 13, 2022
4de6e1f
(U2C #4) use PHP 8 type declarations and strict mode (#105)
eli-darkly Oct 13, 2022
8e5ddd6
(U2C #5) misc syntax cleanup to take advantage of modern language fea…
eli-darkly Oct 13, 2022
cb7e69a
(U2C 6) factor evaluation logic out of model classes (#107)
eli-darkly Oct 13, 2022
9e55395
(U2C #7) support contextKind in clauses (#108)
eli-darkly Oct 14, 2022
7f16210
(U2C #8) support contextTargets (#109)
eli-darkly Oct 14, 2022
5d88c20
(U2C #9) support contextKind in rollouts/experiments (#110)
eli-darkly Oct 14, 2022
0e461ea
(U2C #10) support includedContexts/excludedContexts in segment (#111)
eli-darkly Oct 14, 2022
285a17d
support attribute reference lookups in evaluations
eli-darkly Oct 14, 2022
426df0b
misc fixes
eli-darkly Oct 14, 2022
f135640
move AttributeReference class and create instances of it
eli-darkly Oct 18, 2022
2b35a1e
lint
eli-darkly Oct 18, 2022
f1ffff4
improve error handling/logging in evaluations
eli-darkly Oct 19, 2022
a0eff0a
misc fixes
eli-darkly Oct 19, 2022
b6aa2e6
fix exception string conversion
eli-darkly Oct 19, 2022
86a853a
(U2C #11) support attribute reference lookups in evaluations (#112)
eli-darkly Oct 19, 2022
f58fece
Merge branch '5.0' into eb/sc-172158/eval-errors
eli-darkly Oct 19, 2022
b8ca3c4
comment
eli-darkly Oct 19, 2022
90cee85
revert unnecessary change
eli-darkly Oct 19, 2022
5249e08
update all event logic for U2C
eli-darkly Oct 20, 2022
0053143
(U2C #12) improve error handling/logging in evaluations (#113)
eli-darkly Oct 20, 2022
27186d9
Merge branch '5.0' into eb/sc-172160/events
eli-darkly Oct 20, 2022
1b192f5
coalesce operator makes Elvis operator redundant
eli-darkly Oct 20, 2022
4de9054
more coalesce
eli-darkly Oct 20, 2022
ffcbdcc
(U2C #13) update all event logic for U2C (#114)
eli-darkly Oct 20, 2022
c053007
remove LDUser and LDUserBuilder (#115)
eli-darkly Oct 20, 2022
dc0ace9
Merge branch 'eb/sc-172160/events' into 5.0
eli-darkly Oct 20, 2022
e821ab8
(U2C #15) implement prerequisite cycle detection (#120)
eli-darkly Oct 20, 2022
de1ffe0
(U2C #16) implement segment recursion and segment cycle detection (#117)
eli-darkly Oct 20, 2022
ee0017a
(U2C #17) make AttributeReference public in new Types namespace (#118)
eli-darkly Oct 24, 2022
df8a154
(U2C #18) move EventPublisher & FeatureRequester out of main namespac…
eli-darkly Oct 24, 2022
ba5947c
(U2C #19) remove deprecated things, clean up tests (#121)
eli-darkly Oct 24, 2022
118d4aa
re-add LDUser, allow SDK to accept it interchangeably with LDContext
eli-darkly Nov 21, 2022
81855fe
doc comment improvements
eli-darkly Dec 21, 2022
d265dd0
fix custom attribute validation for old users
eli-darkly Dec 21, 2022
a4fea61
fix user conversion
eli-darkly Dec 21, 2022
078eaa3
Merge pull request #122 from launchdarkly/eb/sc-177541/re-add-user
eli-darkly Dec 22, 2022
0d66c96
update TestData API to use context kinds (#123)
eli-darkly Dec 22, 2022
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
20 changes: 5 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ workflows:
- test-on-linux:
matrix:
parameters:
php-version: ["7.3", "7.4", "8.0", "8.1"]
php-version: ["8.0", "8.1"]
composer-dependencies: ["lowest", "highest"]
- test-on-windows

Expand Down Expand Up @@ -77,22 +77,12 @@ jobs:
name: downgrade to lowest versions
command: composer update --prefer-lowest --prefer-stable

- run:
name: psalm linting
command: ./vendor/bin/psalm --no-cache
- when:
condition:
not:
equal: [ "8.1", <<parameters.php-version>> ]
steps:
- run:
name: php-cs-fixer check
command: composer cs-check
- run:
name: run tests
command: php -d xdebug.mode=coverage vendor/bin/phpunit
environment:
XDEBUG_MODE: coverage
command: make test
- run:
name: lint
command: make lint

- run:
name: build contract test service
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.iml
composer.phar
.php_cs.cache
.php-cs-fixer.cache
.vagrant
integration-tests/vendor
composer.lock
Expand Down
4 changes: 3 additions & 1 deletion .ldrelease/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ publications:
description: Packagist

jobs:
- template:
- docker:
image: ldcircleci/php-sdk-release:4 # Releaser's default for PHP is still php-sdk-release:3, which is PHP 7.x
template:
name: php

documentation:
Expand Down
15 changes: 14 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ composer install

To run all unit tests:

```
```shell
./vendor/bin/phpunit

# Or, as a shortcut in Linux:
make test
```

It is preferable to run tests against all supported minor versions of PHP (as described in `README.md` under Requirements), or at least the lowest and highest versions, prior to submitting a pull request. However, LaunchDarkly's CI tests will run automatically against all supported versions.
Expand All @@ -45,3 +48,13 @@ To run the SDK contract test suite in Linux (see [`test-service/README.md`](./te
```bash
make contract-tests
```

To run the Psalm linter and cs-check:

```shell
./vendor/bin/psalm --no-cache
composer cs-check

# Or, as a shortcut in Linux:
make lint
```
23 changes: 13 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@

test:
php -d xdebug.mode=coverage vendor/bin/phpunit

lint:
./vendor/bin/psalm --no-cache
composer cs-check


TEMP_TEST_OUTPUT=/tmp/sse-contract-test-service.log

# TEST_HARNESS_PARAMS can be set to add -skip parameters for any contract tests that cannot yet pass
# Explanation of current skips:
# - "secondary": In the PHP SDK this is not an addressable attribute for clauses; in other
# SDKs, it is. This was underspecified in the past; in future major versions, the other
# SDKs and the contract tests will be in line with the PHP behavior.
# - "date - bad syntax", "semver - bad type": The PHP SDK has insufficiently strict
# validation for these types. We will definitely fix this in 5.0 but may or may not
# address it in 4.x, since it does not prevent any valid values from working.
# - "evaluation/parameterized/attribute references/array index is not supported": Due to how PHP
# arrays work, there's no way to disallow an array index lookup without breaking object property
# lookups for properties that are numeric strings.
TEST_HARNESS_PARAMS := $(TEST_HARNESS_PARAMS) \
-skip 'evaluation/parameterized/secondary' \
-skip 'evaluation/parameterized/operators - date - bad syntax' \
-skip 'evaluation/parameterized/operators - semver - bad type'
-skip 'evaluation/parameterized/attribute references/array index is not supported'

build-contract-tests:
@cd test-service && composer install --no-progress
Expand All @@ -26,7 +29,7 @@ start-contract-test-service-bg:

run-contract-tests:
@curl -s https://raw.githubusercontent.com/launchdarkly/sdk-test-harness/main/downloader/run.sh \
| VERSION=v1 PARAMS="-url http://localhost:8000 -debug -stop-service-at-end $(TEST_HARNESS_PARAMS)" sh
| VERSION=v2 PARAMS="-url http://localhost:8000 -debug -stop-service-at-end $(TEST_HARNESS_PARAMS)" sh

contract-tests: build-contract-tests start-contract-test-service-bg run-contract-tests

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

## Supported PHP versions

This version of the LaunchDarkly SDK is compatible with PHP 7.3 and higher.
This version of the LaunchDarkly SDK is compatible with PHP 8.0 and higher.

## Getting started

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
}
],
"require": {
"php": ">=7.3",
"monolog/monolog": "^1.6|^2.0|^3.0",
"php": ">=8.0",
"monolog/monolog": "^2.0|^3.0",
"psr/log": "^1.0|^2.0|^3.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": ">=2.18.0 <3.0",
"guzzlehttp/guzzle": "^6.3 | ^7",
"friendsofphp/php-cs-fixer": "^3.12.0",
"guzzlehttp/guzzle": "^7",
"kevinrob/guzzle-cache-middleware": "^4.0",
"phpunit/php-code-coverage": "^9",
"phpunit/phpunit": "^9",
Expand Down
30 changes: 14 additions & 16 deletions src/LaunchDarkly/EvaluationDetail.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaunchDarkly;

/**
Expand All @@ -9,43 +11,39 @@
*/
class EvaluationDetail
{
/** @var int|null */
private $_variationIndex = null;

/** @var mixed|null */
private $_value = null;

/** @var EvaluationReason */
private $_reason;
private ?int $_variationIndex = null;
private mixed $_value = null;
private EvaluationReason $_reason;

/**
* EvaluationDetail constructor.
* @param mixed|null $value the value of the flag variation
* @param mixed $value the value of the flag variation
* @param int|null $variationIndex the index of the flag variation, or null if it was the default value
* @param EvaluationReason $reason evaluation reason properties
*/
public function __construct($value, ?int $variationIndex, EvaluationReason $reason)
public function __construct(mixed $value, ?int $variationIndex, EvaluationReason $reason)
{
$this->_value = $value;
$this->_variationIndex = $variationIndex;
$this->_reason = $reason;
}

/**
* Returns the value of the flag variation for the user.
* Returns the result of the flag evaluation. This will be either one of the flag's variations or the default
* value that was passed to the {@see \LaunchDarkly\LDClient::variationDetail()} method.
*
* @return mixed
* @return mixed the flag value
*/
public function getValue()
public function getValue(): mixed
{
return $this->_value;
}

/**
* Returns the index of the flag variation for the user, e.g. 0 for the first variation -
* or null if it was the default value.
* The index of the returned value within the flag's list of variations, e.g. 0 for the first variation--
* or null if it was the default value (evaluation failed).
*
* @return int | null
* @return ?int the variation index if applicable
*/
public function getVariationIndex(): ?int
{
Expand Down
33 changes: 12 additions & 21 deletions src/LaunchDarkly/EvaluationReason.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaunchDarkly;

/**
Expand Down Expand Up @@ -81,23 +83,12 @@ class EvaluationReason implements \JsonSerializable
*/
const EXCEPTION_ERROR = 'EXCEPTION';

/** @var string */
private $_kind;

/** @var string|null */
private $_errorKind;

/** @var int|null */
private $_ruleIndex;

/** @var string|null */
private $_ruleId;

/** @var string|null */
private $_prerequisiteKey;

/** @var bool */
private $_inExperiment;
private string $_kind;
private ?string $_errorKind;
private ?int $_ruleIndex;
private ?string $_ruleId;
private ?string $_prerequisiteKey;
private bool $_inExperiment;

/**
* Creates a new instance of the OFF reason.
Expand Down Expand Up @@ -228,7 +219,7 @@ public function getPrerequisiteKey(): ?string
/**
* Returns true if the evaluation resulted in an experiment rollout *and* served
* one of the variations in the experiment. Otherwise it returns false.
* @return boolean
* @return bool
*/
public function isInExperiment(): bool
{
Expand All @@ -242,11 +233,11 @@ public function __toString(): string
{
switch ($this->_kind) {
case self::RULE_MATCH:
return $this->_kind . '(' . ($this->_ruleIndex ?? 0) . ',' . ($this->_ruleId ?? '') . ')';
return $this->_kind . '(' . ($this->_ruleIndex ?: 0) . ',' . ($this->_ruleId ?: '') . ')';
case self::PREREQUISITE_FAILED:
return $this->_kind . '(' . ($this->_prerequisiteKey ?? '') . ')';
return $this->_kind . '(' . ($this->_prerequisiteKey ?: '') . ')';
case self::ERROR:
return $this->_kind . '(' . ($this->_errorKind ?? '') . ')';
return $this->_kind . '(' . ($this->_errorKind ?: '') . ')';
default:
return $this->_kind;
}
Expand Down
32 changes: 12 additions & 20 deletions src/LaunchDarkly/FeatureFlagsState.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaunchDarkly;

use LaunchDarkly\Impl\Model\FeatureFlag;
Expand All @@ -15,14 +17,9 @@
*/
class FeatureFlagsState implements \JsonSerializable
{
/** @var bool */
protected $_valid = false;

/** @var array */
protected $_flagValues;

/** @var array<string, array{debugEventsUntilDate?: int|null, reason?: EvaluationReason, trackEvents?: true, variation?: int|null, version?: int}> **/
protected $_flagMetadata;
protected bool $_valid = false;
protected array $_flagValues;
protected array $_flagMetadata;

/**
* @ignore
Expand All @@ -44,16 +41,15 @@ public function __construct(bool $valid)
public function addFlag(
FeatureFlag $flag,
EvaluationDetail $detail,
bool $forceReasonTracking = false,
bool $withReason = false,
bool $detailsOnlyIfTracked = false
): void {
$requireExperimentData = $flag->isExperiment($detail->getReason());

$this->_flagValues[$flag->getKey()] = $detail->getValue();
$meta = [];

$trackEvents = $flag->isTrackEvents() || $requireExperimentData;
$trackReason = $requireExperimentData;
$trackEvents = $flag->isTrackEvents() || $forceReasonTracking;
$trackReason = $forceReasonTracking;

$omitDetails = false;
if ($detailsOnlyIfTracked) {
Expand Down Expand Up @@ -100,9 +96,9 @@ public function isValid(): bool
* @param string $key the feature flag key
* @return mixed the flag's value; null if the flag returned the default value, or if there was no such flag
*/
public function getFlagValue(string $key)
public function getFlagValue(string $key): mixed
{
return isset($this->_flagValues[$key]) ? $this->_flagValues[$key] : null;
return $this->_flagValues[$key] ?? null;
}

/**
Expand All @@ -115,11 +111,7 @@ public function getFlagValue(string $key)
*/
public function getFlagReason(string $key): ?EvaluationReason
{
if (isset($this->_flagMetadata[$key])) {
$meta = $this->_flagMetadata[$key];
return isset($meta['reason']) ? $meta['reason'] : null;
}
return null;
return ($this->_flagMetadata[$key] ?? [])['reason'] ?? null;
}

/**
Expand Down Expand Up @@ -155,7 +147,7 @@ public function jsonSerialize(): array
$metaMap = [];
foreach ($this->_flagMetadata as $key => $meta) {
$meta = array_replace([], $meta);
if (isset($meta['reason'])) {
if ($meta['reason'] ?? null) {
$meta['reason'] = $meta['reason']->jsonSerialize();
}
$metaMap[$key] = $meta;
Expand Down
35 changes: 0 additions & 35 deletions src/LaunchDarkly/Impl/EvalResult.php

This file was deleted.

Loading