Skip to content

Commit 702df0c

Browse files
authored
chore: Update README.md (#21)
Signed-off-by: Dmitriy Derepko <[email protected]> Formatted readme a bit and fixed using static method. Signed-off-by: Dmitriy Derepko <[email protected]>
1 parent 60ba176 commit 702df0c

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Future development goals for the package include:
1818

1919
## Installation
2020

21-
```
22-
$ composer require open-feature/sdk // installs the latest version
21+
```shell
22+
composer require open-feature/sdk
2323
```
2424

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

32-
class MyClass {
32+
class MyClass
33+
{
3334
private OpenFeatureClient $client;
3435

35-
public function __construct() {
36+
public function __construct()
37+
{
3638
$this->client = OpenFeatureAPI::getInstance()->getClient('MyClass');
3739
}
3840

@@ -78,13 +80,14 @@ class MyClass {
7880
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.
7981

8082
```php
81-
8283
use OpenFeature\OpenFeatureAPI;
8384
use OpenFeature\Providers\Flagd\FlagdProvider;
8485

85-
class MyApp {
86-
public function bootstrap(){
87-
$api = OpenFeatureAPI.getInstance();
86+
class MyApp
87+
{
88+
public function bootstrap()
89+
{
90+
$api = OpenFeatureAPI::getInstance();
8891
$api->setProvider(new FlagdProvider());
8992
$client = $api->getClient();
9093

0 commit comments

Comments
 (0)