Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Improve the extension #55
Hi, I'd like to discourage you from using the CompilerExtension concept. The fact that PHPStan uses Nette\DI is not a public API and can break. Also, it means that this PHPStan extension is not usable with phpstan-shim (PHAR) where Nette is prefixed.
Also, I will remove the global variables in the next version, I didn't realize that someone would access and read them intentionally - they're not part of PHPStan's official API :)
CompilerExtension - will PHPStan provide any way to integration with the container? Otherwise the bootstrap or autoload files have no way of interacting with PHPStan -- even if the current setup is a hack.
Global variables -- I'm looking to move from those and should have used
Drupal doesn't have all of its classes dumped to the autoloader. We need to find the Drupal root and then do namespace processing. For this I need to know the current working directory, and
Basically the extension, right now, uses that info and pumps data into globals for use later.
referenced a pull request that will
May 10, 2019
You can create some classes lazily with a factory so that parameters don’t have to initially exist.
On Fri, 10 May 2019 at 22:55, Matt Glaman ***@***.***> wrote: This helped remove some of the magical globals. However, it cannot be fully used. Parameters need to be added to the container for service detection. Opened an initial branch and experimenting. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#55 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAAZTOGX7S3T7ASYWJXMYGLPUXOKZANCNFSM4HEI7OXQ> .
-- Ondřej Mirtes