Skip to content

Commit

Permalink
Use imports instead of FQNs in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Vegner committed Jan 10, 2018
1 parent 2906cf1 commit 30d7f7f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,11 @@ This way defining a consumer in a following way will tell a container to inject
into it --- or to throw an exception if it's not available.

```php
class ExampleConsumer implements SD\DependencyInjeciton\AutoDeclarerInterface {
use SD\DependencyInjeciton\AutoDeclarerTrait;
use SD\DependencyInjection\AutoDeclarerInterface;
use SD\DependencyInjection\AutoDeclarerTrait;

class ExampleConsumer implements AutoDeclarerInterface {
use AutoDeclarerTrait;
use ExampleAwareTrait;

// An example way to access an example service instance.
Expand All @@ -188,8 +191,10 @@ Service providers
You can encapsulate a service's common name further by putting it into a provider.

```php
// This provides a correspondance between the service instance and its common name.
class ExampleProvider implements SD\DependencyInjection\ProviderInterface {
use SD\DependencyInjection\ProviderInterface;

// This provides a correspondence between the service instance and its common name.
class ExampleProvider implements ProviderInterface {
public function getServiceName(): string {
return 'example'; // the common name
}
Expand Down

0 comments on commit 30d7f7f

Please sign in to comment.