1

我的团队从事 symfony flex 项目。它对我们来说有点新。我的作曲家文件:

{
"type": "project",
"license": "proprietary",
"minimum-stability": "dev",
"require": {
    "php": "^7.1",
    "symfony/console": "^3.4",
    "symfony/flex": "^1.0",
    "symfony/framework-bundle": "^3.4",
    "symfony/lts": "^3",
    "symfony/yaml": "^3.4",
    "guzzlehttp/guzzle": "~6.0",
    "league/flysystem-aws-s3-v3": "^1.0",
    "oneup/flysystem-bundle": "^2.0",
    "php-amqplib/rabbitmq-bundle": "^1.13"
},
"require-dev": {
    "symfony/dotenv": "^3.4",
    "behat/behat": "^3.4",
    "behat/symfony2-extension": "^2.1",
    "mockery/mockery": "^1.0",
    "phpunit/phpunit": "^6.4"
},
"config": {
    "preferred-install": {
        "*": "dist"
    },
    "sort-packages": true
},
"autoload": {
    "psr-4": {
        "App\\": "src/"
    }
},
"autoload-dev": {
    "psr-4": {
        "App\\Tests\\": "tests/"
    }
},
"scripts": {
    "auto-scripts": {
        "cache:clear": "symfony-cmd"
    },
    "post-install-cmd": [
        "@auto-scripts"
    ],
    "post-update-cmd": [
        "@auto-scripts"
    ]
},
"conflict": {
    "symfony/symfony": "*"
},
"extra": {
    "symfony": {
        "id": "01BY8F14MYNYFXEQV8P8QRJQHS",
        "allow-contrib": false
    }
}

}

当我运行 composer install 时,出现以下错误:

    Script cache:clear returned with error code 1
!!  PHP Warning:  Module 'apcu' already loaded in Unknown on line 0
!!
!!  In DefinitionErrorExceptionPass.php line 37:
!!
!!    Cannot autowire service "App\Services\ApiRequestValidator": argument "$secr
!!    et" of method "__construct()" must have a type-hint or be given a value exp
!!    licitly.
!!
!!
!!

在进行 composer install 时,我们观察到 symfony 在 config 文件夹中创建了 service.yaml 文件。我们只想使用基于PHP 的服务和路由配置中定义的基于 php 的配置。

如果我删除 service.yaml 文件并再次运行 composer install 它运行良好。我不确定为什么 symfony 在我的 config 文件夹中已经有基于 php 的服务配置时会显式创建 service.yaml 文件。

这也阻止了我启动我的 docker 容器。

4

0 回答 0