Changeset 1083

Show
Ignore:
Timestamp:
11/28/07 14:45:02 (9 months ago)
Author:
mikey
Message:

implemented enhancement #111 for all reflection classes constructing other reflection classes
fixed bug in stubReflectionMethod

Files:

Legend:

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

    r1027 r1083  
    2828     */ 
    2929    protected $className; 
    30     /** 
    31      * docblock comment for this class 
    32      * 
    33      * @var  string 
    34      */ 
    35     protected $docComment; 
    3630 
    3731    /** 
     
    5751        $this->className = $className; 
    5852        parent::__construct($className); 
    59         $this->docComment = $this->getDocComment(); 
    6053    } 
    6154 
     
    6861    public function hasAnnotation($annotationName) 
    6962    { 
    70         return stubAnnotationFactory::has($this->docComment, $annotationName, stubAnnotation::TARGET_CLASS, $this->className, $this->getFileName()); 
     63        return stubAnnotationFactory::has($this->getDocComment(), $annotationName, stubAnnotation::TARGET_CLASS, $this->className, $this->getFileName()); 
    7164    } 
    7265 
     
    8073    public function getAnnotation($annotationName) 
    8174    { 
    82         return stubAnnotationFactory::create($this->docComment, $annotationName, stubAnnotation::TARGET_CLASS, $this->className, $this->getFileName()); 
     75        return stubAnnotationFactory::create($this->getDocComment(), $annotationName, stubAnnotation::TARGET_CLASS, $this->className, $this->getFileName()); 
    8376    } 
    8477 
     
    159152        } 
    160153         
    161         $stubRefMethod = new stubReflectionMethod($this->className, $name); 
     154        $stubRefMethod = new stubReflectionMethod($this, $name); 
    162155        return $stubRefMethod; 
    163156    } 
     
    173166        $stubMethods = array(); 
    174167        foreach ($methods as $method) { 
    175             $stubMethods[] = new stubReflectionMethod($this->className, $method->getName()); 
     168            $stubMethods[] = new stubReflectionMethod($this, $method->getName()); 
    176169        } 
    177170         
     
    191184        } 
    192185         
    193         $stubRefProperty = new stubReflectionProperty($this->className, $name); 
     186        $stubRefProperty = new stubReflectionProperty($this, $name); 
    194187        return $stubRefProperty; 
    195188    } 
     
    205198        $stubProperties = array(); 
    206199        foreach ($properties as $property) { 
    207             $stubProperties[] = new stubReflectionProperty($this->className, $property->getName()); 
     200            $stubProperties[] = new stubReflectionProperty($this, $property->getName()); 
    208201        } 
    209202         
  • trunk/src/main/php/net/stubbles/reflection/stubReflectionFunction.php

    r1078 r1083  
    114114        $stubParameters = array(); 
    115115        foreach ($parameters as $parameter) { 
    116             $stubParameters[] = new stubReflectionParameter($this->functionName, $parameter->getName()); 
     116            $stubParameters[] = new stubReflectionParameter($this, $parameter->getName()); 
    117117        } 
    118118         
  • trunk/src/main/php/net/stubbles/reflection/stubReflectionMethod.php

    r1082 r1083  
    126126        $refClass = parent::getDeclaringClass(); 
    127127        if ($refClass->getName() === $this->className) { 
    128             if (null !== $this->refClass) { 
     128            if (null === $this->refClass) { 
    129129                $this->refClass = new stubReflectionClass($this->className); 
    130130            } 
     
    147147        $stubParameters = array(); 
    148148        foreach ($parameters as $parameter) { 
    149             $stubParameters[] = new stubReflectionParameter(array($this->className, $this->methodName), $parameter->getName()); 
     149            $stubParameters[] = new stubReflectionParameter($this, $parameter->getName()); 
    150150        } 
    151151         
  • trunk/src/main/php/net/stubbles/reflection/stubReflectionObject.php

    r940 r1083  
    3535     */ 
    3636    protected $classObject; 
    37     /** 
    38      * docblock comment for this class 
    39      * 
    40      * @var  string 
    41      */ 
    42     protected $docComment; 
    4337 
    4438    /** 
     
    5246        $this->classObject = $classObject; 
    5347        parent::__construct($classObject); 
    54         $this->docComment = $this->getDocComment(); 
    5548    } 
    5649 
     
    6356    public function hasAnnotation($annotationName) 
    6457    { 
    65         return stubAnnotationFactory::has($this->docComment, $annotationName, stubAnnotation::TARGET_CLASS, $this->className, $this->getFileName()); 
     58        return stubAnnotationFactory::has($this->getDocComment(), $annotationName, stubAnnotation::TARGET_CLASS, $this->className, $this->getFileName()); 
    6659    } 
    6760 
     
    7568    public function getAnnotation($annotationName) 
    7669    { 
    77         return stubAnnotationFactory::create($this->docComment, $annotationName, stubAnnotation::TARGET_CLASS, $this->className, $this->getFileName()); 
     70        return stubAnnotationFactory::create($this->getDocComment(), $annotationName, stubAnnotation::TARGET_CLASS, $this->className, $this->getFileName()); 
    7871    } 
    7972 
     
    176169        } 
    177170         
    178         $stubRefMethod = new stubReflectionMethod($this->className, $name); 
     171        $stubRefMethod = new stubReflectionMethod($this, $name); 
    179172        return $stubRefMethod; 
    180173    } 
     
    190183        $stubMethods = array(); 
    191184        foreach ($methods as $method) { 
    192             $stubMethods[] = new stubReflectionMethod($this->className, $method->getName()); 
     185            $stubMethods[] = new stubReflectionMethod($this, $method->getName()); 
    193186        } 
    194187         
     
    208201        } 
    209202         
    210         $stubRefProperty = new stubReflectionProperty($this->className, $name); 
     203        $stubRefProperty = new stubReflectionProperty($this, $name); 
    211204        return $stubRefProperty; 
    212205    } 
     
    222215        $stubProperties = array(); 
    223216        foreach ($properties as $property) { 
    224             $stubProperties[] = new stubReflectionProperty($this->className, $property->getName()); 
     217            $stubProperties[] = new stubReflectionProperty($this, $property->getName()); 
    225218        } 
    226219