Changeset 70

Show
Ignore:
Timestamp:
12/10/06 12:02:21 (2 years ago)
Author:
schst
Message:

Fixed bug #7: check, whether factory method can be called statically

Files:

Legend:

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

    r69 r70  
    6161            $refClass  = new ReflectionClass($this->className); 
    6262            $refMethod = $refClass->getMethod($this->methodName); 
     63            if (!$refMethod->isStatic()) { 
     64                throw new ValueConversionException('Could not create instance of "' . $this->className . '" using the factory method "' . $this->methodName . '" as it is no static method.'); 
     65            } 
    6366            if (method_exists($refMethod, 'invokeArgs') == true) { 
    6467                    $instance = $refMethod->invokeArgs(null, $cParams);