Changeset 1748

Show
Ignore:
Timestamp:
07/29/08 14:00:10 (4 months ago)
Author:
mikey
Message:

simplified net::stubbles::ioc::stubConstantBinding

Files:

Legend:

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

    r1371 r1748  
    88 */ 
    99stubClassLoader::load('net::stubbles::ioc::stubBinding', 
    10                       'net::stubbles::ioc::stubValueInjectionProvider' 
     10                      'net::stubbles::ioc::stubInjectionProvider' 
    1111); 
    1212/** 
     
    1616 * @subpackage  ioc 
    1717 */ 
    18 class stubConstantBinding extends stubBaseObject implements stubBinding 
     18class stubConstantBinding extends stubBaseObject implements stubBinding, stubInjectionProvider 
    1919{ 
    2020    /** 
     
    2929    protected $name          = null; 
    3030    /** 
    31      * provider that holds the binded valu
     31     * value to provid
    3232     * 
    33      * @var  stubValueInjectionProvider 
     33     * @var  mixed 
    3434     */ 
    35     protected $valueProvider; 
    36  
    37     /** 
    38      * constructor 
    39      */ 
    40     public function __construct() 
    41     { 
    42         $this->valueProvider = new stubValueInjectionProvider(); 
    43     } 
     35    protected $value; 
    4436 
    4537    /** 
     
    5143    public function to($value) 
    5244    { 
    53         $this->valueProvider->setValue($value)
     45        $this->value = $value
    5446        return $this; 
    5547    } 
     
    7466    public function getProvider() 
    7567    { 
    76         return $this->valueProvider
     68        return $this
    7769    } 
    7870 
     
    8678        return self::TYPE . '#' . $this->name; 
    8779    } 
     80 
     81    /** 
     82     * returns the value to provide 
     83     * 
     84     * @param   string  $type 
     85     * @param   string  $name 
     86     * @return  mixed 
     87     */ 
     88    public function get($type, $name = null) 
     89    { 
     90        return $this->value; 
     91    } 
    8892} 
    8993?>