Php 类型错误:参数太少,无法运行
services.yml位于src/EliteFifa/MatchBundle/Resources/services.ymlPhp 类型错误:参数太少,无法运行,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
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'