bitExpert / disco

PSR-11 compatible Dependency Injection Container for PHP.
Apache License 2.0
139 stars 17 forks source link

[Feature] Let Disco also generate the phpstorm Meta file for type lookups #19

Open shochdoerfer opened 8 years ago

shochdoerfer commented 8 years ago

PhpStorm supports a so-called Meta file helping with autocompletion for container calls. Add a (Phing) task to generate such a file for the given container configuration to enable autocomplete support for the return values of the BeanFactory::get() calls.

SenseException commented 8 years ago

What about using Composer to create the PHPStorm meta-file on Update/Install? Also: If a meta-file already exists in a project using Disco, it shouldn't be overridden.

shochdoerfer commented 8 years ago

@SenseException My current plan is rather to generate the files when the cache files are written because you want to have a meta file matching the current configuration.

But open to suggestions / improvements ;)

SenseException commented 8 years ago

@shochdoerfer The goal is to manually start the phing task after the dev made changes?

shochdoerfer commented 8 years ago

@SenseException That is what I had in mind then I added the issue. Downside is you would need to manually build the meta-file which means potentially it could be out-of-sync with the configuration. That is why I thought Disco should spit out the file additionally to the cached configuration. That way both files would always be in sync.

SenseException commented 8 years ago

I wouldn't make this file and its generating code a part of this repository. It is PHPStorm only and no help for other IDEs. It is also not needed for running Disco. If this is about PHPStorm, I suggest to create a PHPStorm plugin to separate a development helper from the library.

shochdoerfer commented 8 years ago

My idea was to add a configuration setting so that the user could toggle the generation of the file.