plugin-php
plugin-php copied to clipboard
`use` keyword
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);
}