title: Symfony4 Inject env variable and autowire error "Cannot autowire service"
body: <p>I'm trying to create a service who receive two parameters defined in .env file.</p>
  
  <p>Symfony throws the next error:</p>
  
  <blockquote>
    <p>Cannot autowire service
    "App\Modules\Sales\Infrastructure\Persistence\Http\HttpSalesRepository":
    argument "$credentials" of method "__construct()" is type-hinted "ar<br>
    ray", you should configure its value explicitly.</p>
  </blockquote>
  
  <p>This is my service.yml file:</p>
  
  <pre><code>parameters:
  
  services:
      _defaults:
          autowire: true      # Automatically injects dependencies in your services.
          autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
  
      App\:
          resource: '../src/*'
          exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'
  
      App\Controller\:
          resource: '../src/Controller'
          tags: ['controller.service_arguments']
  
  imports:
      - { resource: "../src/Modules/Sales/Infrastructure/DependencyInjection/sales_module.yml" }
  </code></pre>
  
  <p>This is the code inside sales_module.yml:</p>
  
  <pre><code>services:
    module_sales.http.sales.repository:
      public: false
      class: App\Modules\Sales\Infrastructure\Persistence\Http\HttpSalesRepository
      arguments: ["%env(json:CREDENTIALS)%", "%env(json:TAGS)%"]
  </code></pre>
  
  <p>And this the HttpSalesRepository class</p>
  
  <pre><code>class HttpSalesRepository implements SalesRepository
  {
      private $credentials;
      private $tags;
  
      public function __construct(array $credentials, array $tags)
      {
          $this-&gt;credentials = $credentials;
          $this-&gt;tags = $tags;
      }
      ...
   }
  </code></pre>
  
  <p>And this is the .env file:</p>
  
  <pre><code>###&gt; symfony/framework-bundle ###
  APP_ENV=dev
  APP_SECRET=xxxxxx
  ###&lt; symfony/framework-bundle ###
  
  ###&gt; doctrine/doctrine-bundle ###
  DATABASE_URL=mysql://xxx:yyy@mysql:3306/db
  ###&lt; doctrine/doctrine-bundle ###
  
  ###&gt; application/variables ###
  CREDENTIALS='{"username":"email@test.com","password":"secretpass"}'
  TAGS='["tag1","tag2","tag3"]'
  ###&lt; application/variables ###
  </code></pre>
  
  <p>Any ideas?</p>