Bug #31210

constructor of proxy class not compatible with interfaces defening a constructor

Added by Jordy de Jong almost 4 years ago. Updated over 3 years ago.

Status:New Start date:2011-10-24
Priority:Must have Due date:
Assigned To:- % Done:

0%

Category:Object
Target version:-
PHP Version: Complexity:
Has patch:No Affected Flow version:FLOW3 1.0.0

Description

I have a class which implements an interface. This interface defines a constructor with a parameter. FLOW3 creates a proxy class which constructor is not compatible which the definition of the constructor in the interface.

example:

interface SomeClassInterface {
public function __construct($options = null);
}

class SomeAbstractClass implements SomeClassInterface {
public function __construct($options = null) {
// do stuff...
}
}

class MyClass extends SomeAbstractClass {

}

FLOW3 creates the following:

class MyClass_Original extends SomeAbstractClass {

}

class MyClass extends MyClass_Original {
public function __construct() {
$arguments = func_get_args();

if (!isset($arguments[0])) $arguments[0] = NULL;
call_user_func_array('parent::__construct', $arguments);
}
}

the constructor in the proxy method is not compatible with the constructor defined in the original interface

History

#1 Updated by Karsten Dambekalns over 3 years ago

  • Project changed from TYPO3 Flow Base Distribution to TYPO3.Flow

#2 Updated by Karsten Dambekalns over 3 years ago

  • Category set to Object
  • Has patch set to No

#3 Updated by Karsten Dambekalns over 3 years ago

Interfaces defining constructors are bound to give you problems...

Also available in: Atom PDF