Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Add DocumentedRuleInterface to generate documentation #4463

Merged
merged 1 commit into from
Dec 14, 2024

Conversation

simonschaufi
Copy link
Collaborator

No description provided.

@simonschaufi
Copy link
Collaborator Author

simonschaufi commented Dec 14, 2024

@samsonasik I really appreciate your help with upgrading TYPO3 Rector to version 2.0!

I added the now required DocumentedRuleInterface.

When I run: vendor/bin/phpstan analyse --generate-baseline --memory-limit=-1 --ansi --allow-empty-baseline -vv (script in composer.json to validate that there are no errors) I get some strange errors like the following and I wonder why 1.) phpstan complains and 2.) why they can't be added to the baseline?

Unignorable errors could not be added to the baseline:
Class Ssch\TYPO3Rector\TYPO311\v3\MigrateSpecialLanguagesToTcaTypeLanguageRector implements unknown interface Symplify\RuleDocGenerator\Contract\DocumentedRuleInterface.
/home/github/sabbelasichon/typo3-rector/rules/TYPO311/v3/MigrateSpecialLanguagesToTcaTypeLanguageRector.php

Can you reproduce the error? Do you have any idea what the problem could be? I tried to clear all the phpstan caches but every time I run the command in different php versions, I get the same error. Strangely enough, the CI pipeline is fine... 🤷

@samsonasik
Copy link
Contributor

You may need to include the interface under bootstrapFiles in phpstan.neon

parameters:
    bootstrapFiles:
             - tests/bootstrap-phpstan.php
             - vendor/rector/rector/vendor/symplify/rule-doc-generator-contracts/src/ValueObject/RuleDefinition.php
             - vendor/rector/rector/vendor/symplify/rule-doc-generator-contracts/src/Contract/DocumentedRuleInterface.php

I am on mobile, so probably there are typos, but you got the idea ;)

@simonschaufi
Copy link
Collaborator Author

@samsonasik this indeed fixed the issue! Thank you!

@simonschaufi simonschaufi merged commit d85fb49 into main Dec 14, 2024
33 checks passed
@simonschaufi simonschaufi deleted the rule-doc-generator branch December 14, 2024 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants