Changeset 795

Show
Ignore:
Timestamp:
08/10/07 10:57:22 (1 year ago)
Author:
mikey
Message:

bugfix: PHP reflection classes return false if no parent class exists
whitespace fixes

Files:

Legend:

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

    r698 r795  
    3434     */ 
    3535    protected $docComment; 
    36      
     36 
    3737    /** 
    3838     * constructor 
     
    5555        $this->docComment = $this->getDocComment(); 
    5656    } 
    57      
     57 
    5858    /** 
    5959     * check whether the class has the given annotation or not 
     
    6666        return stubAnnotationFactory::has($this->docComment, $annotationName, stubAnnotation::TARGET_CLASS, $this->className); 
    6767    } 
    68      
     68 
    6969    /** 
    7070     * return the specified annotation 
     
    7878        return stubAnnotationFactory::create($this->docComment, $annotationName, stubAnnotation::TARGET_CLASS, $this->className); 
    7979    } 
    80      
     80 
    8181    /** 
    8282     * checks whether a value is equal to the class 
     
    9393        return false; 
    9494    } 
    95      
     95 
    9696    /** 
    9797     * returns a string representation of the class 
     
    111111        return 'net.stubbles.reflection.stubReflectionClass[' . $this->className . "] {\n}\n"; 
    112112    } 
    113      
     113 
    114114    /** 
    115115     * returns the full qualified class name of the reflected class 
     
    129129        return $fqClassName; 
    130130    } 
    131      
     131 
    132132    /** 
    133133     * returns the constructor or null if none exists 
     
    142142        return $this->getMethod('__construct'); 
    143143    } 
    144      
     144 
    145145    /** 
    146146     * returns the specified method or null if it does not exist 
     
    158158        return $stubRefMethod; 
    159159    } 
    160      
     160 
    161161    /** 
    162162     * returns a list of all methods 
     
    174174        return $stubMethods; 
    175175    } 
    176      
     176 
    177177    /** 
    178178     * returns the specified property or null if it does not exist 
     
    190190        return $stubRefProperty; 
    191191    } 
    192      
     192 
    193193    /** 
    194194     * returns a list of all properties 
     
    206206        return $stubProperties; 
    207207    } 
    208      
     208 
    209209    /** 
    210210     * returns a list of all interfaces 
     
    222222        return $stubRefClasses; 
    223223    } 
    224      
     224 
    225225    /** 
    226226     * returns a list of all interfaces 
     
    231231    { 
    232232        $parentClass  = parent::getParentClass(); 
    233         if (null == $parentClass) { 
     233        if (null === $parentClass || false === $parentClass) { 
    234234            return null; 
    235235        } 
     
    238238        return $stubRefClass; 
    239239    } 
    240      
     240 
    241241    /** 
    242242     * returns the extension to where this class belongs too 
  • trunk/src/main/php/net/stubbles/reflection/stubReflectionObject.php

    r698 r795  
    4141     */ 
    4242    protected $docComment; 
    43      
     43 
    4444    /** 
    4545     * constructor 
     
    5454        $this->docComment = $this->getDocComment(); 
    5555    } 
    56      
     56 
    5757    /** 
    5858     * check whether the class has the given annotation or not 
     
    6565        return stubAnnotationFactory::has($this->docComment, $annotationName, stubAnnotation::TARGET_CLASS, $this->className); 
    6666    } 
    67      
     67 
    6868    /** 
    6969     * return the specified annotation 
     
    7777        return stubAnnotationFactory::create($this->docComment, $annotationName, stubAnnotation::TARGET_CLASS, $this->className); 
    7878    } 
    79      
     79 
    8080    /** 
    8181     * checks whether a value is equal to the class 
     
    104104        return ($compare->className == $this->className && $compareHashCode == $classHashCode); 
    105105    } 
    106      
     106 
    107107    /** 
    108108     * returns a string representation of the class 
     
    122122        return 'net.stubbles.reflection.stubReflectionObject[' . $this->className . "] {\n}\n"; 
    123123    } 
    124      
     124 
    125125    /** 
    126126     * returns the full qualified class name of the reflected class 
     
    140140        return $fqClassName; 
    141141    } 
    142      
     142 
    143143    /** 
    144144     * returns the instance of the class with with this reflection instance was created 
     
    150150        return $this->classObject; 
    151151    } 
    152      
     152 
    153153    /** 
    154154     * returns the constructor or null if none exists 
     
    163163        return $this->getMethod('__construct'); 
    164164    } 
    165      
     165 
    166166    /** 
    167167     * returns the specified method or null if it does not exist 
     
    179179        return $stubRefMethod; 
    180180    } 
    181      
     181 
    182182    /** 
    183183     * returns a list of all methods 
     
    195195        return $stubMethods; 
    196196    } 
    197      
     197 
    198198    /** 
    199199     * returns the specified property or null if it does not exist 
     
    211211        return $stubRefProperty; 
    212212    } 
    213      
     213 
    214214    /** 
    215215     * returns a list of all properties 
     
    227227        return $stubProperties; 
    228228    } 
    229      
     229 
    230230    /** 
    231231     * returns a list of all interfaces 
     
    243243        return $stubRefClasses; 
    244244    } 
    245      
     245 
    246246    /** 
    247247     * returns a list of all interfaces 
     
    252252    { 
    253253        $parentClass  = parent::getParentClass(); 
    254         if (null == $parentClass) { 
     254        if (null === $parentClass || false === $parentClass) { 
    255255            return null; 
    256256        } 
     
    259259        return $stubRefClass; 
    260260    } 
    261      
     261 
    262262    /** 
    263263     * returns the extension to where this class belongs too