Skip to content

Commit 7b54344

Browse files
committed
Initial import
1 parent 353779c commit 7b54344

5 files changed

+14
-4
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ class ServiceDispatcher {
8686

8787
### ObjectFactory
8888

89-
A `ObjectFactory` is mostly useful in common factories to create entities.
89+
A `ObjectFactory` is mostly useful in common factories to create entities. For implementation details, look at the phpdoc-blocks.
9090

9191
### InstanceContainer
9292

93-
A `InstanceContainer` is mostly useful when in subjection to a di-container only a single instance of an object should be used. This is slightly different to the use of a singleton-pattern since you can have multiple di-containers with different configurations that may inject different implementations for
93+
A `InstanceContainer` is mostly useful when in subjection to a di-container only a single instance of an object should be used. This is slightly different to the use of a singleton-pattern since you can have multiple di-containers with different configurations that may inject different implementations for the provided interfaces. For implementation details, look at the phpdoc-blocks.
9494

9595
### MethodInvoker
9696

9797
Invokes a `callable` method, function or closure and resolve the required parameters automatically of not already
98-
provided. Here is a
98+
provided. For implementation details, look at the phpdoc-blocks.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
namespace Ioc\Exceptions;
3+
4+
class DefinitionNotFoundException extends \Exception {
5+
}

src/InstanceContainer.php

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
interface InstanceContainer {
55
/**
66
* Returns an instance of $className. Is no instance of $className exists, it will be created.
7+
* If no matching class could be found, it must throw an Ioc\Exceptions\DefinitionNotFoundException.
78
*
89
* @param string $className
910
* @return object

src/MethodInvoker.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
interface MethodInvoker {
55
/**
66
* Invokes the callable $callable with the arguments $arguments. If arguments were missing in $arguments, the
7-
* method-invoker tries to fill the missing arguments by itself.
7+
* method-invoker tries to fill the missing arguments by itself. The provided callable could be a function, a static
8+
* method or a class not yet instantiated. The implementation determines how to handle the callable and find the
9+
* appropriate method for invocation. If no matching class could be found, it must throw an
10+
* Ioc\Exceptions\DefinitionNotFoundException.
811
*
912
* @param callable $callable
1013
* @param array $arguments

src/ObjectFactory.php

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ interface ObjectFactory {
55
/**
66
* The object-factory creates a class with the name $className and the __construct-arguments $arguments. If
77
* arguments were missing in $arguments, the method-invoker tries to fill the missing arguments by itself.
8+
* If no matching class could be found, it must throw an Ioc\Exceptions\DefinitionNotFoundException.
89
*
910
* @param string $className
1011
* @param array $arguments

0 commit comments

Comments
 (0)