Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Can't inherit abstract function Zend\Validator\Translator\TranslatorInterface::translate() #5354

Closed
ppeiris opened this Issue · 5 comments

6 participants

@ppeiris

I get this error

Can't inherit abstract function Zend\Validator\Translator\TranslatorInterface::translate() (previously declared abstract in Zend\I18n\Translator\TranslatorInterface) in vendor/zendframework/zendframework/library/Zend/Mvc/I18n/Translator.php on line 16

I get the error when I run the code on mac using MAMP (php -v 5.4.17); however running the same code base on ubuntu with php -v 5.4.9 wont give any issues.

I fix the issue by commenting translate() in the Zend\I18n\Translator\TranslatorInterface.php. I assume, since its in the interface class and all the translator methods are already implemented, this (may) not effect the code.

@DASPRiD DASPRiD was assigned
@Maks3w
Collaborator

@ppeiris May you're running the code from the CLI (Mac defaults is 5.3.x)

@DASPRiD May you should attend this.

@weierophinney

This is a known issue on the develop branch for pre-5.3 versions of PHP; @DASPRiD has indicated he'll have something this week to correct the situation.

Basically: we have two TranslatorInterface definitions, one in Zend\I18n and one in Zend\Validator. Zend\Mvc\I18n\Translator is implementing both -- something that works fine starting in 5.4, but which causes issues in 5.3. The solution will most likely be to do a proxy or decorator.

@weierophinney

"Fixed" in the develop branch by upping the minimum supported PHP version to 5.3.23 for the develop branch (upcoming 2.3.0).

@gws gws referenced this issue in aws/aws-sdk-php-zf2
Closed

Compatibility with ZF2 2.3 #18

@sumityadav

Is this still an issue or resolved?

I found this issue when I was working on http://zf2.readthedocs.org/en/latest/tutorials/unittesting.html

PHP Fatal error:  Can't inherit abstract function Zend\Validator\Translator\TranslatorInterface::translate() (previously declared abstract in Zend\I18n\Translator\TranslatorInterface) in zendframework\library\Zend\Mvc\I18n\Translator.php on line 19

OS: Windows 7
PHP: PHP 5.4.12 (cli) (built: Feb 25 2013 00:29:22)
ZF2 Version: 2.3.1

@mungiud

so, how i can resolv this error, i have php 5.3.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.