Changeset 49

Show
Ignore:
Timestamp:
11/28/06 01:51:37 (2 years ago)
Author:
mikey
Message:

bugfix: ignore empty parameter if there is no constructor, this will work for both cases instead of just one as the solution introduced in r40 which broke example1

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/XJConf/converters/ConstructorValueConverter.php

    r40 r49  
    4949        } 
    5050         
    51         if (count($cParams) == 1 && empty($cParams[0]) == true) { 
    52             $cParams = array(); 
    53         } 
    54          
    5551        // try to create a new instance 
    5652        try { 
     
    5955                $instance = $refClass->newInstanceArgs($cParams); 
    6056                } elseif (count($cParams) == 1) { 
    61                     $instance = $refClass->newInstance($cParams[0]); 
     57                    try { 
     58                       $instance = $refClass->newInstance($cParams[0]); 
     59                    } catch (ReflectionException $re) { 
     60                        $instance = $refClass->newInstance(); 
     61                    } 
    6262                } elseif (count($cParams) == 0) { 
    6363                    $instance = $refClass->newInstance();