Skip to content

Commit

Permalink
Merge pull request #260 from nourpups/nourpups-patch-update-old-metho…
Browse files Browse the repository at this point in the history
…d-share-to-addShared

Update old 'share' method to 'addShared'
  • Loading branch information
philipobenito authored Nov 10, 2024
2 parents 72f9beb + c3525cc commit 7477c3c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/4.x/definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ declare(strict_types=1);

$container = new League\Container\Container();

$container->share(Acme\Foo::class);
$container->addShared(Acme\Foo::class);
~~~

If you would like to make all your definitions to default to shared, you can define that on Container, meaning that the `add` method will default to setting your definitions as shared and multiple calls to `get` will return the same instance. Only definitions after this is set will default to shared.
Expand Down

0 comments on commit 7477c3c

Please sign in to comment.