staabm / phpstan-todo-by

Todo comments with expiration
https://staabm.github.io/2023/12/17/phpstan-todo-by-published.html
MIT License
173 stars 4 forks source link

by a semantic version constraint matched against a Composer dependency not working #52

Closed DanielSiepmann closed 8 months ago

DanielSiepmann commented 8 months ago

The "by a semantic version constraint matched against a Composer dependency" approach does not work. We receive the following output:

 ------ ---------------------------------------------------------
  Line   packages/site_codappix/ext_localconf.php
 ------ ---------------------------------------------------------
  10     Package "typo3/cms-core" is not installed via Composer.
 ------ ---------------------------------------------------------

I tried to debug via xdebug and it looks like the !InstalledVersions::isInstalled call is heading to phpstan phar version and its own packages composer dependencies instead of the actual project dependencies.

staabm commented 8 months ago

thanks for reporting. it works in my tests as expected.

could you create a small reproducing repo? It might be something specific to typo3

DanielSiepmann commented 8 months ago

Thanks for your fast response, and sure: https://github.com/DanielSiepmann/phpstan-todo-by-issue-52

I broke our setup down to the minimum. It seems the issue is caused by typo3/minimal dependency. Removing that dependency removes the issue.

So not really related to TYPO3 I guess, but to metapackages in general? I'm not too deep into this topic.

staabm commented 8 months ago

thanks for the repro. as soon as typo3/minimal is removed from the repro it starts to work. it seems one of typo3/minimal dependencies is fiddling with autoloading.

maybe you can reduce it further from this point?

DanielSiepmann commented 8 months ago

I could further reduce to only include typo3/cms-core and typo3/cms-backend.

staabm commented 8 months ago

thank you.

I think it will be fixed with https://github.com/staabm/phpstan-todo-by/pull/54 - I need a proper automated test for staabm/phpstan-todo-by to land it though.

could you work on that?

staabm commented 8 months ago

fix released in https://github.com/staabm/phpstan-todo-by/releases/tag/0.1.17

DanielSiepmann commented 8 months ago

Thank you very much for such a fast fix. I'll give it a try tomorrow and only respond if we still have issues :)

github-actions[bot] commented 7 months ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.