Closed alexanderschnitzler closed 6 months ago
I guess there is already a stub loader handling loading of stubs based on TYPO3 version, maybe use that for now: https://github.com/sascha-egerer/phpstan-typo3/blob/master/src/Stubs/StubFilesExtensionLoader.php
Thanks @DanielSiepmann! I will have a look and see what's doable with that.
I had a look into the issue and i think we could use almost all stubs from TYPO3 Core since TYPO3 12.4. IMHO there is only one piece missing or left.
The line https://github.com/TYPO3-CMS/extbase/blob/12.4/Classes/Persistence/Repository.php#L330 should be:
php @return class-string<static> Class name of the repository.
@oliverklee What do you think? Should we change this line in Core?
Should we change this line in Core?
Yes, that makes sense (in main, 13.0, 12.4, 11.5
).
@sabbelasichon Would you be willing to create the change? Then I can review it.
Can we close this issue? It's possible to define stubs based on TYPO3 version so i don't think we have a TODO here right now, right?
@sascha-egerer Let me check.
Hey, as of TYPO3 12.x, the Extbase domain layer has full support for generics. In contrary to the stubs, it uses
T
, notTEntity
. It doesn't cause any problems unless you want to use the new "generic" find methods of the RepositoryfindBy()
,findOneBy
andcountBy
. Those are not covered by the stubs and useT
and therefore phpstan fails to gather their return types.What's the plan with this package? Will it continue to support multiple TYPO3 versions? Do you want to adjust the stubs?
To be frank: I think we should focus on letting the core handle the phpstan implementation and remove everything from this package that isn't needed any more.
Is there an option to disable/enable stubs dynamically? I doubt it but it would be really good to tell this package what TYPO3 version is running and it selectively enables/disables it's features.