[TYPO3-core] QueryInterface-compat for CMS 6.1 and 6.2?

Xavier Perseguers xavier at typo3.org
Thu Apr 10 08:58:28 CEST 2014


> The QueryInterface (Extbase Persistence) changed between 6.1 and 6.2.
> In 6.1 one param is given just with an annotation for an "object" in
> phpdoc, 6.2 now mentions a param of a certain class.

The interface was actually cleaned up a lot in the last days before
release of 6.2 because it was actually a pretty mess with partially
wrong annotations or hints.

Though nothing against the work that was done in Extbase before of
course, but we decided to get a clean base for the new LTS

> Do I guess right that it's not possible (at least not without a hack) to
> have an implementation that works with both interfaces?

I just tested this:


interface A_61 {
        public function foo($mydate);

interface A_62 {
        public function foo(DateTime $mydate);

class B_61 implements A_61 {
        public function foo($mydate) { return 'ok'; }

class B_62 implements A_62 {
        public function foo($mydate) { return 'ok'; }

class C_61 implements A_61 {
        public function foo(DateTime $mydate) { return 'ok'; }

class C_62 implements A_62 {
        public function foo(DateTime $mydate) { return 'ok'; }

when I run it, I get

Fatal error: Declaration of B_62::foo() must be compatible with that of

So the C_* implementations seem to be fine for everyone, both the 6.1
world and the new, strict 6.2 world.

Xavier Perseguers
TYPO3 CMS Team Member

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org

More information about the TYPO3-team-core mailing list