Gernott / mask

TYPO3 Extension Mask
https://www.facebook.com/typo3mask
GNU General Public License v2.0
130 stars 86 forks source link

mask uses friendsoftypo3/phpstan-typo3 which is for core only (based on README) #544

Closed sypets closed 1 year ago

sypets commented 1 year ago

Is there a reason mask uses friendsoftypo3/phpstan-typo3 and not for example saschaegerer/phpstan-typo3 in composer.json?

See

I found this extension and the one from Sascha (saschaegerer/phpstan-typo3). Why are there two extensions and which should I use?

Well, this package has one specific purpose. It's made to help making the TYPO3 core phpstan max level compatible. To achieve this, the core team needs to be able to have its own extension which can be quickly adjusted as soon as the core itself changes. If for example, a new core version is released, the core team can quickly raise the dependency constraints for typo3/cms-core and typo3/cms-extbase which cannot be done when working with Sascha's package.

Also, Sascha's package contains dynamic return type providers that are not needed (yet) to make the core more compatible with phpstan.

To sum it all up: There is no competition between both extensions and this extension should not be used by users but only by the TYPO3 core.

https://packagist.org/packages/friendsoftypo3/phpstan-typo3

nhovratov commented 1 year ago

Hi Sybille, I just copied the exact test setup from the core. There are lots of packages using it actually: https://packagist.org/packages/friendsoftypo3/phpstan-typo3/dependents?order_by=downloads

For now I'm inclined to keep it like this. I tried to install Saschas package and phpstan is still green. So there is no real reason to switch at the moment.

nhovratov commented 1 year ago

I'll close it for now. Will keep it in my head though if this becomes necessary.

sypets commented 1 year ago

@nhovratov Thanks for the reply.

For me it is not so much about mask (you are free to use whatever you want, of course), but to research what are the currently used and recommended dev packages and to clarify open questions.

Having 2 packages for phpstan TYPO3 is potentially a bit confusing, thought in practice it is probably not much of a problem.

But, if extension maintainers say it is only for the core, but extensions are using it, I think it might be a good solution to either update the README of phpstan-typo3 (it is maybe appropriate to say use at your own risk, may be subject to changes without notice, rather than not recommended to use) or recommend not to use it.

My main intention and focus here are the extension developers and contributors - if similar dev packages and setup are used (at least for the basic stuff) across extensions (and core) - this makes contribution much easier.

As you are already using a lot of the setup from the core your extension is a good example.

Anyhow, I do not wish to annoy and pester the extension authors with unnecessary questions and suggestions, it is sometimes difficult to find a good course of action here.

nhovratov commented 1 year ago

@sypets It's not annoying at all, thanks for bringing this up! I haven't had it on my radar at all, that there is another package. I like to stick as close as possible to the core utilities, as this basically guarantees me updates for free. Now, I'm probably not the one to decide what is the right way. You are totally right about unifying used packages across third-party extensions. This will simplify contribution immensely.