feat: BaseAPI의 launch()에 타입 지정

- APIRecoveryType이 명시
This commit is contained in:
2023-03-17 01:39:10 +09:00
parent 6b9cfe46a0
commit 4d340abdcf
77 changed files with 171 additions and 89 deletions
+7 -4
View File
@@ -2,6 +2,8 @@
namespace sammo;
use sammo\Enums\APIRecoveryType;
abstract class BaseAPI
{
const NO_SESSION = -1;
@@ -13,7 +15,8 @@ abstract class BaseAPI
static array $sensitiveArgs = [];
static bool $allowExternalAPI = true;
public function getFilteredArgs(): array {
public function getFilteredArgs(): array
{
$filteredArgs = $this->args;
foreach (static::$sensitiveArgs as $argName) {
if (isset($filteredArgs[$argName])) {
@@ -33,10 +36,10 @@ abstract class BaseAPI
abstract public function getRequiredSessionMode(): int;
abstract function validateArgs(): ?string;
/** @return null|string|array */
abstract function launch(Session $session, ?\DateTimeInterface $modifiedSince, ?string $reqEtag);
abstract function launch(Session $session, ?\DateTimeInterface $modifiedSince, ?string $reqEtag): null | string | array | APIRecoveryType;
public function tryCache():?APICacheResult{
public function tryCache(): ?APICacheResult
{
return null;
}
}