PHPStan: forbid superfluous `use SomeTrait` (when the trait contains zero private methods)
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3576694. -->
Reported by: [wim leers](https://www.drupal.org/user/99777)
Related to !665
>>>
<h3 id="overview">Overview</h3>
<blockquote><p>
💡This means that any subclass of `CanvasKernelTestBase` should no longer `use` this trait! But neither PHPCS nor PHPStan complain about this. This is a wider problem, so I won't hold this MR on it.
</p></blockquote>
<p>— yours truly at <a href="https://git.drupalcode.org/project/canvas/-/merge_requests/583/diffs#note_710143">https://git.drupalcode.org/project/canvas/-/merge_requests/583/diffs#note_710143</a>, where </p>
<pre> use ConstraintViolationsTestTrait;</pre><p>
was added to <code>CanvasKernelTestBase</code>, which means that none of the subclasses need to <code>use</code> it anymore.</p>
<h3 id="proposed-resolution">Proposed resolution</h3>
<p>Use an existing PHPStan rule, or a custom one if need be.</p>
<h3 id="ui-changes">User interface changes</h3>
<p>None.</p>
> Related issue: [Issue #3400366](https://www.drupal.org/node/3400366)
issue