Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
philipobenito committed Jul 23, 2018
2 parents 2554710 + 3bde189 commit c50b0d6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/2.x/auto-wiring.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Auto Wiring

# Auto Wiring

> Note: Auto wiring is turned off by default but can be turned on by registering the `ReflectionContainer` as a container delegate. Read below and see the [documentation on delegates](/delegates/).
> Note: Auto wiring is turned off by default but can be turned on by registering the `ReflectionContainer` as a container delegate. Read below and see the [documentation on delegates](/2.x/delegates/).
Container has the power to automatically resolve your objects and all of their dependencies recursively by inspecting the type hints of your constructor arguments. Unfortunately, this method of resolution has a few small limitations but is great for smaller apps. First of all, you are limited to constructor injection and secondly, all injections must be objects.

Expand Down
6 changes: 3 additions & 3 deletions docs/2.x/inflectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ This is useful for example when you want to invoke a method on all objects that
Imagine that you have a `LoggerAwareInterface` and would like to invoke the method called `setLogger` passing in a logger every time a class is retrieved that implements this interface.

~~~ php
$container->register('Some\Logger');
$container->register('Some\LoggerAwareClass'); // implements LoggerAwareInterface
$container->register('Some\Other\LoggerAwareClass'); // implements LoggerAwareInterface
$container->add('Some\Logger');
$container->add('Some\LoggerAwareClass'); // implements LoggerAwareInterface
$container->add('Some\Other\LoggerAwareClass'); // implements LoggerAwareInterface

$container->inflector('LoggerAwareInterface')
->invokeMethod('setLogger', ['Some\Logger']); // Some\Logger will be resolved via the container
Expand Down
2 changes: 1 addition & 1 deletion src/ContainerAwareTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function setContainer(ContainerInterface $container): ContainerAwareInter
/**
* Get the container.
*
* @return \League\Container\ContainerInterface
* @return \Psr\Container\ContainerInterface
*/
public function getContainer(): ContainerInterface
{
Expand Down

0 comments on commit c50b0d6

Please sign in to comment.