API helper classes

This commit is contained in:
2024-07-18 08:19:07 -04:00
parent bac4cf4236
commit b1b976913c
10 changed files with 365 additions and 0 deletions

View File

@ -0,0 +1,13 @@
<?php
namespace ProVM\Exception\Authorization;
use Throwable;
use Exception;
class MissingBearer extends Exception
{
public function __construct(Throwable $previous = null)
{
parent::__construct('Missing Bearer token', 401, $previous);
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace ProVM\Exception\Authorization;
use Throwable;
use Exception;
class MissingHeader extends Exception
{
public function __construct(Throwable $previous = null)
{
parent::__construct('No Authorization header found', 401, $previous);
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace ProVM\Exception\Authorization;
use Throwable;
use Exception;
class MissingToken extends Exception
{
public function __construct(string $placement, Throwable $previous)
{
parent::__construct("No token found in {$placement}", 401, $previous);
}
}