Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to exclude multiple directories when using Symfony autowire?

When using autowire in Symfony 4 I used this working code:

App\:
    resource: '../src/*'
    exclude: '../src/{Domain,Entity,Migrations,Tests}'

That code excludes from the autowiring all this folders:

- src/Domain
- src/Entity
- src/Migrations
- src/Tests

That is ok, but the problem comes when I want to exclude multiple folders with the same name that are dispersed inside another folders.

For example if we have this structure:

  • src/Folder1/FolderToExclude
  • src/Folder2/Folder2-1/FolderToExclude

¿Is there some way to exclude all folders with name FolderToExclude?

I already tried the following code with some small variations:

App\:
    resource: '../src/*'
    exclude: '../src/{Domain,Entity,Migrations,Tests,**/FolderToExclude}'

But it does not work :(

like image 649
Diguin Avatar asked Jan 17 '18 17:01

Diguin


1 Answers

In Symfony 4.1. But there is an closed bug and a pull request that may make this feature available for symfony 4.2 !

like image 76
magnetik Avatar answered Sep 17 '22 12:09

magnetik