Bug #31210

constructor of proxy class not compatible with interfaces defening a constructor

Added by Jordy de Jong almost 10 years ago. Updated over 9 years ago.

Status:
New
Priority:
Must have
Assignee:
-
Category:
Object
Target version:
-
Start date:
2011-10-24
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

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

#1

Updated by Karsten Dambekalns over 9 years ago

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

Updated by Karsten Dambekalns over 9 years ago

  • Category set to Object
  • Has patch set to No
#3

Updated by Karsten Dambekalns over 9 years ago

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

Also available in: Atom PDF