1.2.1301. Unused Traits¶
Those traits are not used in any class or trait. They are probably dead code, as there is no way to use a trait without a host class.
<?php
// unused trait
trait unusedTrait { /**/ }
// used trait
trait tUsedInTrait { /**/ }
trait tUsedInClass {
use tUsedInTrait;
/**/
}
class foo {
use tUsedInClass;
}
?>
1.2.1301.1. Suggestions¶
Remove the unused trait
Actually use the trait in one class or another trait
1.2.1301.2. Specs¶
Short name |
Traits/UnusedTrait |
Rulesets |
|
Exakat since |
0.8.4 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Slow (1 hour) |
Precision |
Very high |
Features |
trait |
Available in |