Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
chipslays committed Apr 10, 2024
1 parent a55119e commit 9a90ca8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ composer require please/container
## Basic usage
```php
use Please\Container\Container;
use Please\Container\Support\Getter;

$container = new Container;

$container->bind(Mailer::class, function (Container $container, array $parameters) {
return new Mailer::($parameters['user'], $parameters['password']);
$container->bind(Mailer::class, function (Getter $get) {
return new Mailer::($get('user'), $get('password', 'qwerty')); // qwerty - default value
});

/** @var Mailer */
Expand Down

0 comments on commit 9a90ca8

Please sign in to comment.