Skip to content

chore: Update README.md #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 19, 2022
Merged
Changes from all commits
Commits
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
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Future development goals for the package include:

## Installation

```
$ composer require open-feature/sdk // installs the latest version
```shell
composer require open-feature/sdk
```

## Usage
Expand All @@ -29,10 +29,12 @@ While `Boolean` provides the simplest introduction, we offer a variety of flag t
```php
use OpenFeature\OpenFeatureClient;

class MyClass {
class MyClass
{
private OpenFeatureClient $client;

public function __construct() {
public function __construct()
{
$this->client = OpenFeatureAPI::getInstance()->getClient('MyClass');
}

Expand Down Expand Up @@ -78,13 +80,14 @@ class MyClass {
To configure OpenFeature, you'll need to add a provider to the global singleton `OpenFeatureAPI`. From there, you can generate a `Client` which is usable by your code. If you do not set a provider, then the `NoOpProvider`, which simply returns the default passed in, will be used.

```php

use OpenFeature\OpenFeatureAPI;
use OpenFeature\Providers\Flagd\FlagdProvider;

class MyApp {
public function bootstrap(){
$api = OpenFeatureAPI.getInstance();
class MyApp
{
public function bootstrap()
{
$api = OpenFeatureAPI::getInstance();
$api->setProvider(new FlagdProvider());
$client = $api->getClient();

Expand Down