我使用的是PHP 7.2,我得到了以下错误:
PHP Fatal error: A void function must not return a value
Compile Error: A void function must not return a value出现这种情况是因为/common看起来不支持return :void。我的composer.json文件中包含以下内容:
"php": "7.2.*",
"symfony/symfony": "~3.4",
"doctrine/orm": "dev-master",
"doctrine/doctrine-bundle": "~1.5",
"doctrine/data-fixtures": "dev-master",
"doctrine/doctrine-fixtures-bundle": "dev-master",
"doctrine/migrations": "dev-master",
"doctrine/doctrine-migrations-bundle": "dev-master",
"stof/doctrine-extensions-bundle": "dev-master",但它看起来像是在2017年1月首次报告的这个问题,如下所示:https://github.com/doctrine/doctrine2/issues/6221仍然没有修复。或者我还漏掉了什么?
发布于 2018-10-05 22:42:17
因此,解决这个问题的方法是在我的composer文件中使用"@stable“。
"doctrine/data-fixtures": "@stable",
"doctrine/doctrine-fixtures-bundle": "@stable",
"doctrine/migrations": "@stable",
"doctrine/doctrine-migrations-bundle": "@stable",
"stof/doctrine-extensions-bundle": "@stable",https://stackoverflow.com/questions/52663932
复制相似问题