安装WellCommerce时Symfony返回类型声明错误

时间:2016-09-05 13:38:58

标签: symfony return-type php-7 symfony-3.1

我使用PHP7在我的服务器中为symfony3安装wellCommerce,我收到此错误:

FatalErrorException in AdminSubscriber.php line 74:
Parse Error: syntax error, unexpected ':', expecting ';' or '{'

产生此错误的代码是:

private function getUserRepository() : UserRepositoryInterface
{
    return $this->get('user.repository');
}

我在php7上阅读了返回类型声明,我不知道为什么我收到此错误。

非常感谢你的帮助。

1 个答案:

答案 0 :(得分:1)

我已经安装了PHP5.6和PHP7,但apache默认使用PHP5.6。要解决此问题,我将删除服务器中的所有PHP并安装最新版本的PHP7.1。