plugin-php icon indicating copy to clipboard operation
plugin-php copied to clipboard

`use` keyword

Open LoryPelli opened this issue 10 months ago • 0 comments

If I don't use that keyword, it gives errors with formatting if typing full namespace under an if statement (I think) or only for local namespaces (ServerError is locally in the project)

if ($isAPI && $_SERVER['REQUEST_METHOD'] != 'POST') {
    ServerError::METHOD_NOT_ALLOWED->send();
    exit(1);
}
if (!$exists) {
    ServerError::NOT_FOUND->send();
    exit(1);
}

it gives error if:

if ($isAPI && $_SERVER['REQUEST_METHOD'] != 'POST') {
    TestPHP\Enums\ServerError::METHOD_NOT_ALLOWED->send();
    exit(1);
}
if (!$exists) {
    TestPHP\Enums\ServerError::NOT_FOUND->send();
    exit(1);
}

LoryPelli avatar Apr 17 '25 06:04 LoryPelli