Giter Club home page Giter Club logo

php-sdk's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

php-sdk's Issues

Unit tests: No-op provider default

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.

Unit tests: base hooks

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.

[FEATURE] Spec 0.5.1

Requirements

There isn't any work really for this besides updating the docstrings in the SDK to properly annotate the requirement target numbers

Changes to support spec `v0.6.0`, `v0.7.0` compliance

Implement specification v0.7.0 changes

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).

Functional requirements:

Non-functional requirements:

  • add relevant tests
  • add examples and documentation, see template README
  • update specification badge to v0.7.0: Specification

Keep in mind:

  • backwards compatibility is highly encouraged
    • take every precaution to ensure existing code written by application authors and existing providers implementations, do not break
  • it's recommended these features are released together

Unit test: No-op client mutators

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.

Hook execution behavior

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.

Cleanup: Remove commented code on globals

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.

Unit test: No-op client default

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.

Drop support for EOL PHP 8.0

This includes upgrading to newer language offerings like native enums

  • Drop support for PHP 8.0
  • Refactor to utilize native enums
  • Refactor to read-only properties
  • Refactor to intersection types
  • Refactor to final class constants
  • Refactor to object array unpacking
  • Ensure null parameters are marked as such

Reference: https://www.php.net/releases/8.1/en.php

[DOCS] SDK

Using something like ReadTheDocs or similar, provide documentation for usage of the PHP SDK.

Update SDK to be compliant with spec v0.5.0

Update the SDK to be compliant with the v0.5.0 spec.

What's Changed

โš  BREAKING CHANGES

Additional changes

General

  • Add/update a spec version badge on the readme.

Specification

Full Changelog: open-feature/spec@v0.4.0...v0.5.0

[BUG] AbstractHook incorrectly defines finally hook method

Observed behavior

AbstractHook helper class for implementing hooks (and the shared super class of various helpers like BooleanHook) defines an abstract finallyAfter method.

Expected Behavior

AbstractHook should define an abstract method finally conforming to the Hook interface

Steps to reproduce

Look at the source code

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

asdf
.tool-versions
  • php 8.2.12
composer
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-actions
.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

  • Check this box to trigger a request for Renovate to run again on this repository

[BUG] release-please fails to tag release in GitHub

Observed behavior

Merging the release-please PR failed to tag and relase on GitHub

Expected Behavior

A new GitHub release is created along with a tag

Steps to reproduce

Merge a standard release-please PR

[FEATURE] Support of Caching PSR-16

Requirements

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.

Unit test: client getVersion

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.

[CHORE] Deprecate PHP 7.4 support

Requirements

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.