open-feature / php-sdk Goto Github PK
View Code? Open in Web Editor NEWPHP implementation of the OpenFeature SDK
Home Page: https://openfeature.dev
License: Apache License 2.0
PHP implementation of the OpenFeature SDK
Home Page: https://openfeature.dev
License: Apache License 2.0
We return a No-op provider if none has been provided by the user. This is not validated by unit testing. Add a unit test for this scenario.
There a base hook classes for each flag type.
These are not individually tested so account for missing lines in our Codecov. Additionally, they should have a basic test to ensure they behave as expected.
These should ensure that the shouldResolveFlag
only triggers for the specific flag type for the respective hook.
Add a CONTRIBUTING.md file for interested developers to get started ๐
Codecov integrated into our CI processes
Execution of integration tests utilizing the test-harness repository, the BDD tests, and the flagd provider.
This utility class needs more coverage for decapitalize
There isn't any work really for this besides updating the docstrings in the SDK to properly annotate the requirement target numbers
See changes since last release.
Please note there's no need to complete all these tasks in a single PR (in fact, that's not recommended).
v0.7.0
: You can set hooks and evaluation context but these are non-actionable, since they don't truly impact the return values. Add unit tests to cover these.
Please see the open discussion here for more information: open-feature/spec#164
Essentially, some SDKs simply reverse the calculated before
hooks (API
, Client
, Invocation
, Provider
), and others generate the list with the original lists of Provider
, Invocation
, Client
, and API
.
This can result in varying behavior between SDKs.
The preference in the JS SDK is reversal. The Python SDK has also been updated to do reversal. PHP should likely do the same, but there is continuing discussion on the issue linked.
Depending on what PHP runtime is used, we cannot expect the $_SESSION
to exist, and we don't want to reduce compatibility with other runtimes.
Remove the commented code considering use of $_SESSION
for global singleton.
If an error is thrown while generating the OpenFeatureClient, we return a No-op client in its stead. Add a unit test to validate this scenario.
Update the readme to follow the new template. Once this is ready, the documentation can be configured to pull from the repo automatically.
Examples from other repos:
This includes upgrading to newer language offerings like native enums
Reference: https://www.php.net/releases/8.1/en.php
Using something like ReadTheDocs or similar, provide documentation for usage of the PHP SDK.
We don't need to import a package to provide enum functionality, we can use them once we're on PHP ^8.1
Update the SDK to be compliant with the v0.5.0 spec.
reason
must be a string in the flag resolution details
and evaluation details
.error message
to flag resolution details
.Full Changelog: open-feature/spec@v0.4.0...v0.5.0
AbstractHook
helper class for implementing hooks (and the shared super class of various helpers like BooleanHook
) defines an abstract finallyAfter
method.
AbstractHook
should define an abstract method finally
conforming to the Hook
interface
Look at the source code
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.
.tool-versions
php 8.2.12
composer.json
php ^8
myclabs/php-enum ^1.8
psr/log ^2.0 || ^3.0
behat/behat ^3.11
captainhook/captainhook ^5.10
captainhook/plugin-composer ^5.3
ergebnis/composer-normalize ^2.25
hamcrest/hamcrest-php ^2.0
mdwheele/zalgo ^0.3.1
mockery/mockery ^1.5
php-parallel-lint/php-console-highlighter ^1.0
php-parallel-lint/php-parallel-lint ^1.3
phpstan/extension-installer ^1.1
phpstan/phpstan ~1.10.0
phpstan/phpstan-mockery ^1.0
phpstan/phpstan-phpunit ^1.1
psalm/plugin-mockery ^1.0.0
psalm/plugin-phpunit ^0.18.0
ramsey/coding-standard ^2.0.3
ramsey/composer-repl ^1.4
ramsey/conventional-commits ^1.3
spatie/phpunit-snapshot-assertions ^4.2
vimeo/psalm ~5.17.0
integration/composer.json
php ^8
open-feature/sdk ^2.0.0
open-feature/flagd-provider ^0.7.0
guzzlehttp/guzzle ^7.5
guzzlehttp/psr7 ^2.4
behat/behat ^3.11
phpunit/phpunit ^9.5
.github/workflows/lint-pr.yml
amannn/action-semantic-pull-request v5
.github/workflows/pullrequest.yml
actions/checkout v4
shivammathur/setup-php v2
actions/cache v4
codecov/codecov-action v3
actions/cache v4
.github/workflows/release-please.yml
google-github-actions/release-please-action v4
There are no scenarios we expect this error to occur, but should an invalid flag type be provided to resolve in the client, an error is thrown. Add a unit test to cover this case.
Support for the latest test-harness with the Flagd provider
Merging the release-please PR failed to tag and relase on GitHub
A new GitHub release is created along with a tag
Merge a standard release-please PR
It would be nice if the SDK would support caching of the flag requests.
For example add a psr/simple-cache compatible cache storage and then store the results for better performance.
This way not every provider has to implement its own caching.
I looked into hooks but as far as I understand its not possible to implement a caching hook.
The return type is always just an EvaluationContext so its not possible to prevent requesting within a hook.
There is no unit test written to cover retrieving the version from the client. This is a standard accessor method that is trivial to implement for the OpenFeatureClient.
The PHP 7.4 version is end of life and is not receiving further security updates. We will no longer support this version. Deprecate the target for 7.4.
This also frees up package updates such as psr/log
(#41)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.