-
-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Thanks for this extension, it helps to make components better!
Though, I have a LiveComponent that uses Symfony\UX\LiveComponent\ComponentWithFormTrait where lives the abstract protected method abstract protected function instantiateForm(): FormInterface;
So I have to implement it in my component but to follow the MethodsShouldBePublicOrPrivateRule rule, I have to make it private which makes PHPStan throw a method.unused error
Method App\Twig\Component\MyComponentExample::instantiateForm() is unused.
If I keep it protected (as it was before using your extension), PHPStan does not complain about the method being unused but regarding the MethodsShouldBePublicOrPrivateRule not being followed:
Method "instantiateForm()" in a Twig component should not be protected.
πͺͺ symfonyUX.twigComponent.methodsShouldBePublicOrPrivate
π‘ Twig component methods should be either public or private, not protected.
Edit: I currently silent PHPStan by adding the following docblock at the top of the method.
/**
* @phpstan-ignore method.unused (used by ComponentWithFormTrait)
*/