Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
  • Loading branch information
ghostwriter authored Apr 8, 2023
1 parent 55d3ff2 commit 6ff9f6c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ class TasksServiceProvider implements ServiceProviderInterface
{
public function __invoke(ContainerInterface $container)
{
$container->bind(Task::class);

$container->alias(TaskInterface::class, Task::class);

$container->set(Tasks::class, function (Container $container) {
Expand All @@ -92,8 +90,9 @@ $container->register(TasksServiceProvider::class);
Registering a service extension on the container.

```php
$container->bind(GitHubClient::class);
$container->extend(GitHubClient::class, function (Container $container, object $client) {
$container->alias(GitHubClientInterface::class, GitHubClient::class);

$container->extend(GitHubClientInterface::class, function (Container $container, object $client) {
$client->setEnterpriseUrl($container->get(GitHubClient::GITHUB_HOST));
});

Expand All @@ -111,8 +110,8 @@ class GitHubExtension implements ExtensionInterface
}
}

$container->bind(GitHubClient::class);
$container->add(GitHubClient::class, $container->get(GitHubExtention::class));
$container->alias(GitHubClientInterface::class, GitHubClient::class);
$container->extend(GitHubClientInterface::class, $container->get(GitHubExtention::class));
```

### Testing
Expand Down

0 comments on commit 6ff9f6c

Please sign in to comment.