Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/242.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Symfony 4上的\u方法返回错误_Php_Symfony_Symfony 4.3 - Fatal编程技术网

Php Symfony 4上的\u方法返回错误

Php Symfony 4上的\u方法返回错误,php,symfony,symfony-4.3,Php,Symfony,Symfony 4.3,我正在学习Symfony 4并尝试在twig中使用is_-grated方法,但不幸的是,它返回了错误: HTTP 500 Internal Server Error Argument 4 passed to Symfony\Component\Security\Core\Event\VoteEvent::__construct() must be of the type int, null given, called in /var/www/vendor/symfony/security-cor

我正在学习Symfony 4并尝试在twig中使用is_-grated方法,但不幸的是,它返回了错误:

HTTP 500 Internal Server Error
Argument 4 passed to Symfony\Component\Security\Core\Event\VoteEvent::__construct() must be of the type int, null given, called in /var/www/vendor/symfony/security-core/Authorization/Voter/TraceableVoter.php on line 41
这是我的密码

{% if is_granted('ROLE_USER') %}
{% endif %}
我还不知道选民,但想使用的是被授予的方法只?这里有什么问题


任何帮助都将不胜感激。

这里有一个类似的点:投票者的
vote()
方法没有a
返回
,该返回用于创建
VoteEvent
这里有一个类似的点:投票者的
vote()
方法没有a
返回
,它用于创建一个
VoteEvent

,从技术上讲,应该没有问题。您自己添加了投票人吗?:投票人的
vote()
方法没有A
return
@AlisterBulman将您的评论作为答案,我将投票作为答案技术上应该没有问题。您自己添加了投票人吗?:投票人的
vote()
方法没有A
return
@AlisterBulman将您的评论作为答案,我将投票作为答案是的,导师在开始时给出了未完成的VoterExample,后来成了问题是的,导师在开始时给出了未完成的VoterExample,后来成了问题