Skip to content

Commit

Permalink
add type check
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Feb 12, 2022
1 parent bf461d9 commit 072465e
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 27 deletions.
13 changes: 7 additions & 6 deletions src/Backend/View/App/Token/QueryFilter.php
Expand Up @@ -38,7 +38,6 @@ class QueryFilter extends QueryFilterAbstract
protected ?int $userId = null;
protected ?int $status = null;
protected ?string $scope = null;

protected ?string $ip = null;

public function getAppId(): ?int
Expand Down Expand Up @@ -117,11 +116,13 @@ public static function create(RequestInterface $request): static
}
}

$filter->appId = $appId;
$filter->userId = $userId;
$filter->status = $status;
$filter->scope = $scope;
$filter->ip = $ip;
if ($filter instanceof self) {
$filter->appId = $appId;
$filter->userId = $userId;
$filter->status = $status;
$filter->scope = $scope;
$filter->ip = $ip;
}

return $filter;
}
Expand Down
12 changes: 7 additions & 5 deletions src/Backend/View/Audit/QueryFilter.php
Expand Up @@ -116,11 +116,13 @@ public static function create(RequestInterface $request): static
}
}

$filter->appId = $appId;
$filter->userId = $userId;
$filter->event = $event;
$filter->ip = $ip;
$filter->message = $message;
if ($filter instanceof self) {
$filter->appId = $appId;
$filter->userId = $userId;
$filter->event = $event;
$filter->ip = $ip;
$filter->message = $message;
}

return $filter;
}
Expand Down
20 changes: 11 additions & 9 deletions src/Backend/View/Log/QueryFilter.php
Expand Up @@ -166,15 +166,17 @@ public static function create(RequestInterface $request): static
}
}

$filter->routeId = $routeId;
$filter->appId = $appId;
$filter->userId = $userId;
$filter->ip = $ip;
$filter->userAgent = $userAgent;
$filter->method = $method;
$filter->path = $path;
$filter->header = $header;
$filter->body = $body;
if ($filter instanceof self) {
$filter->routeId = $routeId;
$filter->appId = $appId;
$filter->userId = $userId;
$filter->ip = $ip;
$filter->userAgent = $userAgent;
$filter->method = $method;
$filter->path = $path;
$filter->header = $header;
$filter->body = $body;
}

return $filter;
}
Expand Down
9 changes: 5 additions & 4 deletions src/Backend/View/Plan/Usage/QueryFilter.php
Expand Up @@ -84,11 +84,12 @@ public static function create(RequestInterface $request): static
$routeId = $request->get('routeId');
$userId = $request->get('userId');
$appId = $request->get('appId');
$search = $request->get('search');

$filter->routeId = $routeId;
$filter->userId = $userId;
$filter->appId = $appId;
if ($filter instanceof self) {
$filter->routeId = $routeId;
$filter->userId = $userId;
$filter->appId = $appId;
}

return $filter;
}
Expand Down
8 changes: 5 additions & 3 deletions src/Backend/View/Transaction/QueryFilter.php
Expand Up @@ -99,9 +99,11 @@ public static function create(RequestInterface $request): static
}
}

$filter->invoiceId = $invoiceId;
$filter->status = $status;
$filter->provider = $provider;
if ($filter instanceof self) {
$filter->invoiceId = $invoiceId;
$filter->status = $status;
$filter->provider = $provider;
}

return $filter;
}
Expand Down

0 comments on commit 072465e

Please sign in to comment.