Coding-standard: UnusedUses Removes Used Class

Created on 1 Mar 2019  路  3Comments  路  Source: slevomat/coding-standard

Running slevomat code-standards 5.0.1

SlevomatCodingStandard.Namespaces.UnusedUses given the following file

<?php

use Lang\Misc;

echo htmlentities(Misc::SKIP_TO_CONTENT);

if( $this->header ) { ?>
    <?php echo Misc::BACK_TO_TOP;
}

Marks the use as unused. If the if is removed however, it is not.

Fairly strange behaviour.

Wontfix

Most helpful comment

I鈥檒l probably not fix this. I don鈥檛 think our sniffs should be used for templates.

All 3 comments

I鈥檒l probably not fix this. I don鈥檛 think our sniffs should be used for templates.

It also affects

<?php

use Lang\Misc;

echo htmlentities(Misc::SKIP_TO_CONTENT);

?> <?php

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings