Changeset 86

Show
Ignore:
Timestamp:
01/24/07 19:24:15 (2 years ago)
Author:
mikey
Message:

fixed bug #8: it is now possible to use the simple types boolean, bool, integer, int, double, float, string, array as types within namespaces together with an instance of XJConfClassLoader

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/XJConf/definitions/AbstractTagDefinition.php

    r85 r86  
    7272        public function getType() 
    7373        { 
    74             if ($this->type != null) { 
    75             if (null != $this->classLoader) { 
     74            if (null != $this->type) { 
     75            if (null != $this->classLoader && in_array($this->type, $this->simpleTypes) == false) { 
    7676                return $this->classLoader->getType($this->type); 
    7777            } 
     
    8080            } 
    8181             
    82             if (null != $this->classLoader) { 
     82            if (null != $this->classLoader && in_array($this->abstractType, $this->simpleTypes) == false) { 
    8383                return $this->classLoader->getType($this->abstractType); 
    8484            } 
     
    102102         
    103103        $refClass = new ReflectionClass(get_class($instance)); 
    104         if (null != $this->classLoader) { 
     104        if (null != $this->classLoader && in_array($this->abstractType, $this->simpleTypes) == false) { 
    105105            $abstractType = $this->classLoader->getType($this->abstractType); 
    106106        } else { 
  • trunk/XJConf/definitions/TagDefinition.php

    r77 r86  
    9292        protected $classLoader    = null; 
    9393        /** 
     94         * list of simple types where the class loader can not be applied to 
     95         * 
     96         * @var  array<string> 
     97         */ 
     98        protected $simpleTypes    = array('boolean', 'bool', 'integer', 'int', 'double', 'float', 'string', 'array'); 
     99        /** 
    94100         * Whether the calls should be made statically or not 
    95101         * 
     
    425431        } 
    426432 
    427         if (null != $this->classLoader) { 
     433        if (null != $this->classLoader && in_array($this->type, $this->simpleTypes) == false) { 
    428434                    $this->classLoader->loadClass($this->type); 
    429435                }