WebimpressCodingStandard.Namespaces.UnusedUseStatement.UnusedUse fails for constant
Closed this issue · 0 comments
geerteltink commented
It fails to detect usage of the JSON_PRETTY_PRINT constant.
use const JSON_PRETTY_PRINT;
class ProblemDetailsResponseFactory
{
public function __construct(
bool $isDebug = self::EXCLUDE_THROWABLE_DETAILS,
?int $jsonFlags = null
) {
$this->isDebug = $isDebug;
if (! $jsonFlags) {
$jsonFlags = JSON_UNESCAPED_SLASHES
| JSON_UNESCAPED_UNICODE
| JSON_PRESERVE_ZERO_FRACTION
| JSON_PARTIAL_OUTPUT_ON_ERROR;
if ($isDebug) {
$jsonFlags = JSON_PRETTY_PRINT | $jsonFlags; // <----- not detected
}
}
}
}