Skip to content
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

fix: typo in php tutorial #159

Merged
merged 1 commit into from
Jun 26, 2023
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
12 changes: 6 additions & 6 deletions docs/tutorials/getting-started/php.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You'll learn how to:

This walk-through assumes that:

- You should have a good understanding of PHP syntax, data types, operators, functions, control structures.
- You should have a good understanding of PHP syntax, data types, operators, functions, and control structures.
- You have PHP 8.0 or later.
- You have Docker installed and running on the host system.

Expand Down Expand Up @@ -58,7 +58,7 @@ Let's install the OpenFeature SDK using the following command.
composer require open-feature/sdk
```

Update `routes/api.php` to import SDK
Update `routes/api.php` to import the SDK

```diff
use Illuminate\Http\Request;
Expand Down Expand Up @@ -128,17 +128,17 @@ Finally, we need to register the provider with OpenFeature.
Route::get('/hello', function () {
$api = OpenFeatureAPI::getInstance();
+
+ $client = new Client();
+ $httpClient = new Client();
+ $httpFactory = new HttpFactory();
+ $api->setProvider(new FlagdProvider([
+ 'httpConfig' => new HttpConfig(
+ $client,
+ $httpClient,
+ $httpFactory,
+ $httpFactory,
+ )
+ ]));
$client = $api->getClient();
if(client->getBooleanValue("welcome-message", false)){
if($client->getBooleanValue("welcome-message", false)){
return response()->json(['message' => 'Hello, World! open feature']);
}
return response()->json(['message' => 'Hello, World!']);
Expand All @@ -165,4 +165,4 @@ Save the changes to `flags.flagd.json` and refresh the browser tab.

This walk-through introduced you to the OpenFeature PHP SDK.
It covered how a provider can be configured to perform the flag evaluation and introduced basic feature flagging concepts.
It also showcased how feature flags can be updated at runtime, without requiring a redeployment.
It also showcased how feature flags can be updated at runtime, without requiring a redeployment.