Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.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 类型错误:参数太少,无法运行_Php_Symfony_Symfony 3.2 - Fatal编程技术网

Php 类型错误:参数太少,无法运行

Php 类型错误:参数太少,无法运行,php,symfony,symfony-3.2,Php,Symfony,Symfony 3.2,services.yml位于src/EliteFifa/MatchBundle/Resources/services.yml parameters: # repositories match_repository.class: EliteFifa\MatchBundle\Repository\MatchRepository match_repository.factory_argument: 'MatchBundle:Match' # serv

services.yml位于src/EliteFifa/MatchBundle/Resources/services.yml

parameters:
    # repositories
    match_repository.class:             EliteFifa\MatchBundle\Repository\MatchRepository
    match_repository.factory_argument:  'MatchBundle:Match'

# services
match_service.class:                EliteFifa\MatchBundle\Service\MatchService

services:
    # services
    elite_fifa.match_service:
        class: %match_service.class%
        arguments:
          - '@elite_fifa.match_repository'
          - '@=service("form.factory")'
          - '@elite_fifa.standing_service'

突然Symfony不再识别其他参数,我添加了
-“@elite\u fifa.standing\u servicee”
,但出现以下错误:

类型错误:参数太少,无法运行 EliteFifa\MatchBundle\Service\Mat chService::\uu构造(),2 传入/home/owner/Desktop/Workspace/EFL/var /缓存/dev/appDevDebugProjectContainer.php在第1128行和第3行 期望


我已尝试清除缓存,但也不起作用。

尝试将
'@=service(“form.factory”)
替换为
'@form.factory'

parameters:
    # repositories
    match_repository.class:             EliteFifa\MatchBundle\Repository\MatchRepository
    match_repository.factory_argument:  'MatchBundle:Match'

# services
match_service.class:                EliteFifa\MatchBundle\Service\MatchService

services:
    # services
    elite_fifa.match_service:
        class: %match_service.class%
        arguments:
          - '@elite_fifa.match_repository'
          - '@form.factory'
          - '@elite_fifa.standing_service'

你想用@=服务(form.factory)做什么?似乎没有必要。你曾经解决过同样的问题吗
parameters:
    # repositories
    match_repository.class:             EliteFifa\MatchBundle\Repository\MatchRepository
    match_repository.factory_argument:  'MatchBundle:Match'

# services
match_service.class:                EliteFifa\MatchBundle\Service\MatchService

services:
    # services
    elite_fifa.match_service:
        class: %match_service.class%
        arguments:
          - '@elite_fifa.match_repository'
          - '@form.factory'
          - '@elite_fifa.standing_service'