From 6ff9f6c32277c050a5c80e5e1161e80caff814a5 Mon Sep 17 00:00:00 2001 From: Nathanael Esayeas Date: Sat, 8 Apr 2023 11:53:59 -0500 Subject: [PATCH] Update README.md Signed-off-by: Nathanael Esayeas --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4900b07..03ad2e0 100644 --- a/README.md +++ b/README.md @@ -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) { @@ -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)); }); @@ -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