-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add Method addTips() to Rule to #218
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requested some changes :)
Also missing a test (with no tips, with one tip, with more than one tip)
385138b
to
92bc1b0
Compare
i tried to implement your suggestions and added an example in the README.md as well. |
It's working well for Relation Assertions (depend on, extend...), but it's missing for Declaration Assertions (is final, is abstract...) In AssertionStep, those assertion methods should be like: public function shouldBeFinal(): TipOrBuildStep
{
$this->rule->assertion = ShouldBeFinal::class;
return new TipOrBuildStep($this->rule);
} and also The CI checks give an error because the php-cs-fixer configuration includes a rule that breaks on PHP 7.4. I will update the config now. Please, rebase or merge from master and edit $reflectedTest = $this->reflectTest(get_class($test)); |
that makes sense :) i'll fix that |
This allows to add reasoning about any given rule via the addTips() implementation of PHPStan.
a60fe76
to
d6dd6e1
Compare
i thought about using a generator and basically test every method for the |
the current tests are good enough :) merging and will deploy soon together with a couple of new features |
yay 🎉 thanks for merging that :) |
thanks for the contribution 🙂 |
This allows to add reasoning about any given rule via the addTips() implementation of PHPStan.
consider the following rule
which would yield
this can add value via reasons or alternative approaches or generic tips.