Changeset 735

Show
Ignore:
Timestamp:
06/14/07 14:28:08 (1 year ago)
Author:
mikey
Message:

added an additional method to annotations that will be called after all values have been set

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/reflection/annotations/stubAbstractAnnotation.php

    r726 r735  
    5353 
    5454    /** 
     55     * do some last operations after all values have been set 
     56     *  
     57     * This method may check if all required values have been set and throw 
     58     * an exception if values are missing. 
     59     * 
     60     * @throws  ReflectionException 
     61     */ 
     62    public function finish() 
     63    { 
     64        // intentionally empty 
     65    } 
     66 
     67    /** 
    5568     * assure that a clone clones all properties of type object as well 
    5669     */ 
  • trunk/src/main/php/net/stubbles/reflection/annotations/stubAnnotation.php

    r720 r735  
    5959 
    6060    /** 
     61     * do some last operations after all values have been set 
     62     *  
     63     * This method may check if all required values have been set and throw 
     64     * an exception if values are missing. 
     65     * 
     66     * @throws  ReflectionException 
     67     */ 
     68    public function finish(); 
     69 
     70    /** 
    6171     * assure that a clone clones all properties of type stubClonable as well 
    6272     *  
  • trunk/src/main/php/net/stubbles/reflection/annotations/stubAnnotationFactory.php

    r564 r735  
    124124            } 
    125125        } 
     126         
     127        $annotation->finish(); 
    126128    } 
    127129 
  • trunk/src/test/php/net/stubbles/reflection/annotations/stubAnnotationFactoryBuildTestCase.php

    r501 r735  
    1111{ 
    1212    protected $foo; 
     13     
     14    protected $finishCalled = false; 
     15     
     16    public function finish() 
     17    { 
     18        $this->finishCalled = true; 
     19    } 
     20     
     21    public function wasFinishCalled() 
     22    { 
     23        return $this->finishCalled; 
     24    } 
    1325     
    1426    public function setFoo($foo) 
     
    5769        stubAnnotationFactory::build($stubAnnotation, $data); 
    5870        $this->assertEqual($stubAnnotation->getFoo(), 'bar'); 
     71        $this->assertTrue($stubAnnotation->wasFinishCalled()); 
    5972    } 
    6073