phpmd
phpmd copied to clipboard
Support for Wildcard Exceptions for StaticAccess Rule
For laravel (and others projects) sometimes the only way is using static access, doing this i fix without turn off the check for other classes:
<rule ref="rulesets/cleancode.xml">
<exclude name="StaticAccess"/>
</rule>
<rule ref="rulesets/cleancode.xml/StaticAccess">
<properties>
<property name="exceptions">
<value>
\Illuminate\Foundation\Inspiring,
\Illuminate\Pagination\LengthAwarePaginator,
\Illuminate\Support\Arr,
\Illuminate\Support\Str
</value>
</property>
</properties>
</rule>
Is useful support pattern:
<rule ref="rulesets/cleancode.xml/StaticAccess">
<properties>
<property name="exceptions">
<value>
\Illuminate\*,
\Respect\Validation\*
</value>
</property>
</properties>
</rule>
If I understand you correctly, you want to support for the * character as a wildcard.
I think that would be useful.
Yes. 😃
Would you be willing to create a pull request?
Yes.
@Webysther are you still interested in creating a PR for this? I would appreciate it. :smile_cat:
Yes, for the next week, please. Sorry.