Skip to content

docs: stray semicolon, add import #60

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
Feb 5, 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
3 changes: 2 additions & 1 deletion docs/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ You must return your extension's unique URI from `uri`.
For every request that includes your extension in the media type, the `handle` method will be called. If your extension is able to handle the request, it should return a PSR-7 response. Otherwise, return null to let the normal handling of the request take place.

```php
use Tobyz\JsonApiServer\Context;
use Tobyz\JsonApiServer\Extension\Extension;
use Psr\Http\Message\ResponseInterface;

Expand All @@ -23,7 +24,7 @@ class MyExtension extends Extension
return 'https://example.org/my-extension';
}

public function handle(Context $context): ?ResponseInterface;
public function handle(Context $context): ?ResponseInterface
{
if ($context->getPath() === '/my-extension') {
return json_api_response([
Expand Down