Changeset 820
- Timestamp:
- 08/14/07 19:22:56 (1 year ago)
- Files:
-
- trunk/experiments/people/schst/ioc/implemented-by.php (added)
- trunk/src/main/php/net/stubbles/ioc/injection/annotations/stubImplementedByAnnotation.php (added)
- trunk/src/main/php/net/stubbles/ioc/injection/stubBinder.php (modified) (1 diff)
- trunk/src/main/php/net/stubbles/ioc/injection/stubInjector.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/ioc/injection/stubBinder.php
r810 r820 17 17 'net.stubbles.ioc.injection.stubInjector', 18 18 'net.stubbles.ioc.injection.stubBindingScope', 19 'net.stubbles.ioc.injection.annotations.stubInjectAnnotation'); 19 'net.stubbles.ioc.injection.annotations.stubInjectAnnotation', 20 'net.stubbles.ioc.injection.annotations.stubImplementedByAnnotation'); 20 21 /** 21 22 * Binder for the IoC functionality. trunk/src/main/php/net/stubbles/ioc/injection/stubInjector.php
r819 r820 49 49 } 50 50 51 // check for default implementation 52 $clazz = new stubReflectionClass($key); 53 if ($clazz->hasAnnotation('ImplementedBy')) { 54 $implementedBy = $clazz->getAnnotation('ImplementedBy'); 55 $tmp = new stubBinding($this, $key); 56 $tmp->to($implementedBy->getDefaultImplementation()); 57 $this->bindings[] = $tmp; 58 return $tmp->getInstance(); 59 } 60 51 61 // try implicit binding 52 62 // TODO: Find a useful location for this code 53 $clazz = new stubReflectionClass($key);54 63 if (!$clazz->isInterface()) { 55 64 $tmp = new stubBinding($this, $key);
