Show
Ignore:
Timestamp:
03/03/08 14:25:14 (10 months ago)
Author:
mikey
Message:

fixed defect #134: stubClassBinding::to() should throw an exception

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/ioc/stubClassBinding.php

    r1371 r1394  
    88 */ 
    99stubClassLoader::load('net::stubbles::ioc::exceptions::stubBindingException', 
     10                      'net::stubbles::ioc::stubBinding', 
     11                      'net::stubbles::ioc::stubBindingScope', 
    1012                      'net::stubbles::ioc::stubDefaultInjectionProvider', 
     13                      'net::stubbles::ioc::stubInjectionProvider', 
     14                      'net::stubbles::ioc::stubValueInjectionProvider', 
     15                      'net::stubbles::lang::exceptions::stubIllegalArgumentException', 
     16                      'net::stubbles::reflection::stubBaseReflectionClass', 
    1117                      'net::stubbles::reflection::stubReflectionClass' 
    1218); 
     
    8086     * @param   stubBaseReflectionClass|string  $impl 
    8187     * @return  stubBinding 
     88     * @throws  stubIllegalArgumentException 
    8289     */ 
    8390    public function to($impl) 
    8491    { 
     92        if (is_string($impl) === false && ($impl instanceof stubBaseReflectionClass) === false) { 
     93            throw new stubIllegalArgumentException('$impl must be a string or an instance of net::stubbles::reflection::stubBaseReflectionClass'); 
     94        } 
     95         
    8596        $this->impl = $impl; 
    8697        return $this;