mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 00:49:02 +00:00
Merge pull request #9500 from appwrite/chore-improve-readability
Improve params readability
This commit is contained in:
commit
b14d76af0d
37 changed files with 405 additions and 79 deletions
|
|
@ -59,8 +59,12 @@ class Get extends Action
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $value, string $type, Response $response, Database $dbForPlatform)
|
||||
{
|
||||
public function action(
|
||||
string $value,
|
||||
string $type,
|
||||
Response $response,
|
||||
Database $dbForPlatform
|
||||
) {
|
||||
if ($type === 'rules') {
|
||||
$validator = new Domain($value);
|
||||
|
||||
|
|
|
|||
|
|
@ -87,8 +87,21 @@ class Create extends Action
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $functionId, ?string $entrypoint, ?string $commands, mixed $code, mixed $activate, Request $request, Response $response, Database $dbForProject, Event $queueForEvents, Document $project, Device $deviceForFunctions, Device $deviceForLocal, Build $queueForBuilds)
|
||||
{
|
||||
public function action(
|
||||
string $functionId,
|
||||
?string $entrypoint,
|
||||
?string $commands,
|
||||
mixed $code,
|
||||
mixed $activate,
|
||||
Request $request,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
Event $queueForEvents,
|
||||
Document $project,
|
||||
Device $deviceForFunctions,
|
||||
Device $deviceForLocal,
|
||||
Build $queueForBuilds
|
||||
) {
|
||||
$activate = \strval($activate) === 'true' || \strval($activate) === '1';
|
||||
|
||||
$function = $dbForProject->getDocument('functions', $functionId);
|
||||
|
|
|
|||
|
|
@ -63,8 +63,15 @@ class Delete extends Action
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $functionId, string $deploymentId, Response $response, Database $dbForProject, DeleteEvent $queueForDeletes, Event $queueForEvents, Device $deviceForFunctions)
|
||||
{
|
||||
public function action(
|
||||
string $functionId,
|
||||
string $deploymentId,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
DeleteEvent $queueForDeletes,
|
||||
Event $queueForEvents,
|
||||
Device $deviceForFunctions
|
||||
) {
|
||||
$function = $dbForProject->getDocument('functions', $functionId);
|
||||
if ($function->isEmpty()) {
|
||||
throw new Exception(Exception::FUNCTION_NOT_FOUND);
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class Get extends Action
|
|||
$this
|
||||
->setHttpMethod(Action::HTTP_REQUEST_METHOD_GET)
|
||||
->setHttpPath('/v1/functions/:functionId/deployments/:deploymentId/download')
|
||||
->httpAlias('/v1/functions/:functionId/deployments/:deploymentId/build/download', [ 'type' => 'output' ])
|
||||
->httpAlias('/v1/functions/:functionId/deployments/:deploymentId/build/download', ['type' => 'output'])
|
||||
->groups(['api', 'functions'])
|
||||
->desc('Download deployment')
|
||||
->label('scope', 'functions.read')
|
||||
|
|
@ -63,8 +63,16 @@ class Get extends Action
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $functionId, string $deploymentId, string $type, Response $response, Request $request, Database $dbForProject, Device $deviceForFunctions, Device $deviceForBuilds)
|
||||
{
|
||||
public function action(
|
||||
string $functionId,
|
||||
string $deploymentId,
|
||||
string $type,
|
||||
Response $response,
|
||||
Request $request,
|
||||
Database $dbForProject,
|
||||
Device $deviceForFunctions,
|
||||
Device $deviceForBuilds
|
||||
) {
|
||||
$function = $dbForProject->getDocument('functions', $functionId);
|
||||
if ($function->isEmpty()) {
|
||||
throw new Exception(Exception::FUNCTION_NOT_FOUND);
|
||||
|
|
|
|||
|
|
@ -64,8 +64,16 @@ class Create extends Action
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $functionId, string $deploymentId, string $buildId, Response $response, Database $dbForProject, Event $queueForEvents, Build $queueForBuilds, Device $deviceForFunctions)
|
||||
{
|
||||
public function action(
|
||||
string $functionId,
|
||||
string $deploymentId,
|
||||
string $buildId,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
Event $queueForEvents,
|
||||
Build $queueForBuilds,
|
||||
Device $deviceForFunctions
|
||||
) {
|
||||
$function = $dbForProject->getDocument('functions', $functionId);
|
||||
|
||||
if ($function->isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -51,8 +51,12 @@ class Get extends Action
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $functionId, string $deploymentId, Response $response, Database $dbForProject)
|
||||
{
|
||||
public function action(
|
||||
string $functionId,
|
||||
string $deploymentId,
|
||||
Response $response,
|
||||
Database $dbForProject
|
||||
) {
|
||||
$function = $dbForProject->getDocument('functions', $functionId);
|
||||
|
||||
if ($function->isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -61,8 +61,14 @@ class Update extends Action
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $functionId, string $deploymentId, Response $response, Database $dbForProject, Document $project, Event $queueForEvents)
|
||||
{
|
||||
public function action(
|
||||
string $functionId,
|
||||
string $deploymentId,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
Document $project,
|
||||
Event $queueForEvents
|
||||
) {
|
||||
$function = $dbForProject->getDocument('functions', $functionId);
|
||||
|
||||
if ($function->isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -77,8 +77,22 @@ class Create extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $functionId, string $repository, string $owner, string $rootDirectory, string $version, bool $activate, Request $request, Response $response, Database $dbForProject, Database $dbForPlatform, Event $queueForEvents, Document $project, Build $queueForBuilds, GitHub $github)
|
||||
{
|
||||
public function action(
|
||||
string $functionId,
|
||||
string $repository,
|
||||
string $owner,
|
||||
string $rootDirectory,
|
||||
string $version,
|
||||
bool $activate,
|
||||
Request $request,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
Database $dbForPlatform,
|
||||
Event $queueForEvents,
|
||||
Document $project,
|
||||
Build $queueForBuilds,
|
||||
GitHub $github
|
||||
) {
|
||||
$function = $dbForProject->getDocument('functions', $functionId);
|
||||
|
||||
if ($function->isEmpty()) {
|
||||
|
|
@ -108,8 +122,8 @@ class Create extends Base
|
|||
);
|
||||
|
||||
$queueForEvents
|
||||
->setParam('functionId', $function->getId())
|
||||
->setParam('deploymentId', $deployment->getId());
|
||||
->setParam('functionId', $function->getId())
|
||||
->setParam('deploymentId', $deployment->getId());
|
||||
|
||||
$response
|
||||
->setStatusCode(Response::STATUS_CODE_ACCEPTED)
|
||||
|
|
|
|||
|
|
@ -74,8 +74,20 @@ class Create extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $functionId, string $type, string $reference, bool $activate, Request $request, Response $response, Database $dbForProject, Database $dbForPlatform, Document $project, Event $queueForEvents, Build $queueForBuilds, GitHub $github)
|
||||
{
|
||||
public function action(
|
||||
string $functionId,
|
||||
string $type,
|
||||
string $reference,
|
||||
bool $activate,
|
||||
Request $request,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
Database $dbForPlatform,
|
||||
Document $project,
|
||||
Event $queueForEvents,
|
||||
Build $queueForBuilds,
|
||||
GitHub $github
|
||||
) {
|
||||
$function = $dbForProject->getDocument('functions', $functionId);
|
||||
|
||||
if ($function->isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -58,8 +58,13 @@ class XList extends Action
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $functionId, array $queries, string $search, Response $response, Database $dbForProject)
|
||||
{
|
||||
public function action(
|
||||
string $functionId,
|
||||
array $queries,
|
||||
string $search,
|
||||
Response $response,
|
||||
Database $dbForProject
|
||||
) {
|
||||
$function = $dbForProject->getDocument('functions', $functionId);
|
||||
|
||||
if ($function->isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -96,8 +96,25 @@ class Create extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $functionId, string $body, mixed $async, string $path, string $method, mixed $headers, ?string $scheduledAt, Response $response, Request $request, Document $project, Database $dbForProject, Database $dbForPlatform, Document $user, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Reader $geodb)
|
||||
{
|
||||
public function action(
|
||||
string $functionId,
|
||||
string $body,
|
||||
mixed $async,
|
||||
string $path,
|
||||
string $method,
|
||||
mixed $headers,
|
||||
?string $scheduledAt,
|
||||
Response $response,
|
||||
Request $request,
|
||||
Document $project,
|
||||
Database $dbForProject,
|
||||
Database $dbForPlatform,
|
||||
Document $user,
|
||||
Event $queueForEvents,
|
||||
StatsUsage $queueForStatsUsage,
|
||||
Func $queueForFunctions,
|
||||
Reader $geodb
|
||||
) {
|
||||
$async = \strval($async) === 'true' || \strval($async) === '1';
|
||||
|
||||
if (!$async && !is_null($scheduledAt)) {
|
||||
|
|
|
|||
|
|
@ -64,8 +64,14 @@ class Delete extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $functionId, string $executionId, Response $response, Database $dbForProject, Database $dbForPlatform, Event $queueForEvents)
|
||||
{
|
||||
public function action(
|
||||
string $functionId,
|
||||
string $executionId,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
Database $dbForPlatform,
|
||||
Event $queueForEvents
|
||||
) {
|
||||
$function = $dbForProject->getDocument('functions', $functionId);
|
||||
|
||||
if ($function->isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -54,8 +54,12 @@ class Get extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $functionId, string $executionId, Response $response, Database $dbForProject)
|
||||
{
|
||||
public function action(
|
||||
string $functionId,
|
||||
string $executionId,
|
||||
Response $response,
|
||||
Database $dbForProject
|
||||
) {
|
||||
$function = Authorization::skip(fn () => $dbForProject->getDocument('functions', $functionId));
|
||||
|
||||
$isAPIKey = Auth::isAppUser(Authorization::getRoles());
|
||||
|
|
|
|||
|
|
@ -59,8 +59,12 @@ class XList extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $functionId, array $queries, Response $response, Database $dbForProject)
|
||||
{
|
||||
public function action(
|
||||
string $functionId,
|
||||
array $queries,
|
||||
Response $response,
|
||||
Database $dbForProject
|
||||
) {
|
||||
$function = Authorization::skip(fn () => $dbForProject->getDocument('functions', $functionId));
|
||||
|
||||
$isAPIKey = Auth::isAppUser(Authorization::getRoles());
|
||||
|
|
|
|||
|
|
@ -100,8 +100,32 @@ class Create extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $functionId, string $name, string $runtime, array $execute, array $events, string $schedule, int $timeout, bool $enabled, bool $logging, string $entrypoint, string $commands, array $scopes, string $installationId, string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, string $specification, Response $response, Database $dbForProject, callable $timelimit, Document $project, Event $queueForEvents, Database $dbForPlatform)
|
||||
{
|
||||
public function action(
|
||||
string $functionId,
|
||||
string $name,
|
||||
string $runtime,
|
||||
array $execute,
|
||||
array $events,
|
||||
string $schedule,
|
||||
int $timeout,
|
||||
bool $enabled,
|
||||
bool $logging,
|
||||
string $entrypoint,
|
||||
string $commands,
|
||||
array $scopes,
|
||||
string $installationId,
|
||||
string $providerRepositoryId,
|
||||
string $providerBranch,
|
||||
bool $providerSilentMode,
|
||||
string $providerRootDirectory,
|
||||
string $specification,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
callable $timelimit,
|
||||
Document $project,
|
||||
Event $queueForEvents,
|
||||
Database $dbForPlatform
|
||||
) {
|
||||
|
||||
// Temporary abuse check
|
||||
$abuseCheck = function () use ($project, $timelimit, $response) {
|
||||
|
|
|
|||
|
|
@ -63,8 +63,14 @@ class Delete extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $functionId, Response $response, Database $dbForProject, DeleteEvent $queueForDeletes, Event $queueForEvents, Database $dbForPlatform)
|
||||
{
|
||||
public function action(
|
||||
string $functionId,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
DeleteEvent $queueForDeletes,
|
||||
Event $queueForEvents,
|
||||
Database $dbForPlatform
|
||||
) {
|
||||
$function = $dbForProject->getDocument('functions', $functionId);
|
||||
|
||||
if ($function->isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -64,8 +64,15 @@ class Update extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $functionId, string $deploymentId, Document $project, Response $response, Database $dbForProject, Event $queueForEvents, Database $dbForPlatform)
|
||||
{
|
||||
public function action(
|
||||
string $functionId,
|
||||
string $deploymentId,
|
||||
Document $project,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
Event $queueForEvents,
|
||||
Database $dbForPlatform
|
||||
) {
|
||||
$function = $dbForProject->getDocument('functions', $functionId);
|
||||
$deployment = $dbForProject->getDocument('deployments', $deploymentId);
|
||||
|
||||
|
|
|
|||
|
|
@ -51,8 +51,11 @@ class Get extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $functionId, Response $response, Database $dbForProject)
|
||||
{
|
||||
public function action(
|
||||
string $functionId,
|
||||
Response $response,
|
||||
Database $dbForProject
|
||||
) {
|
||||
$function = $dbForProject->getDocument('functions', $functionId);
|
||||
|
||||
if ($function->isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -106,8 +106,34 @@ class Update extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $functionId, string $name, string $runtime, array $execute, array $events, string $schedule, int $timeout, bool $enabled, bool $logging, string $entrypoint, string $commands, array $scopes, string $installationId, ?string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, string $specification, Request $request, Response $response, Database $dbForProject, Document $project, Event $queueForEvents, Build $queueForBuilds, Database $dbForPlatform, GitHub $github)
|
||||
{
|
||||
public function action(
|
||||
string $functionId,
|
||||
string $name,
|
||||
string $runtime,
|
||||
array $execute,
|
||||
array $events,
|
||||
string $schedule,
|
||||
int $timeout,
|
||||
bool $enabled,
|
||||
bool $logging,
|
||||
string $entrypoint,
|
||||
string $commands,
|
||||
array $scopes,
|
||||
string $installationId,
|
||||
?string $providerRepositoryId,
|
||||
string $providerBranch,
|
||||
bool $providerSilentMode,
|
||||
string $providerRootDirectory,
|
||||
string $specification,
|
||||
Request $request,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
Document $project,
|
||||
Event $queueForEvents,
|
||||
Build $queueForBuilds,
|
||||
Database $dbForPlatform,
|
||||
GitHub $github
|
||||
) {
|
||||
// TODO: If only branch changes, re-deploy
|
||||
$function = $dbForProject->getDocument('functions', $functionId);
|
||||
|
||||
|
|
|
|||
|
|
@ -57,8 +57,12 @@ class XList extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(array $queries, string $search, Response $response, Database $dbForProject)
|
||||
{
|
||||
public function action(
|
||||
array $queries,
|
||||
string $search,
|
||||
Response $response,
|
||||
Database $dbForProject
|
||||
) {
|
||||
try {
|
||||
$queries = Query::parseQueries($queries);
|
||||
} catch (QueryException $e) {
|
||||
|
|
|
|||
|
|
@ -66,8 +66,15 @@ class Create extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $functionId, string $key, string $value, bool $secret, Response $response, Database $dbForProject, Database $dbForPlatform)
|
||||
{
|
||||
public function action(
|
||||
string $functionId,
|
||||
string $key,
|
||||
string $value,
|
||||
bool $secret,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
Database $dbForPlatform
|
||||
) {
|
||||
$function = $dbForProject->getDocument('functions', $functionId);
|
||||
|
||||
if ($function->isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -59,8 +59,13 @@ class Delete extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $functionId, string $variableId, Response $response, Database $dbForProject, Database $dbForPlatform)
|
||||
{
|
||||
public function action(
|
||||
string $functionId,
|
||||
string $variableId,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
Database $dbForPlatform
|
||||
) {
|
||||
$function = $dbForProject->getDocument('functions', $functionId);
|
||||
|
||||
if ($function->isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -63,8 +63,16 @@ class Update extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $functionId, string $variableId, string $key, ?string $value, ?bool $secret, Response $response, Database $dbForProject, Database $dbForPlatform)
|
||||
{
|
||||
public function action(
|
||||
string $functionId,
|
||||
string $variableId,
|
||||
string $key,
|
||||
?string $value,
|
||||
?bool $secret,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
Database $dbForPlatform
|
||||
) {
|
||||
$function = $dbForProject->getDocument('functions', $functionId);
|
||||
|
||||
if ($function->isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -86,8 +86,23 @@ class Create extends Action
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $siteId, ?string $installCommand, ?string $buildCommand, ?string $outputDirectory, mixed $code, mixed $activate, Request $request, Response $response, Database $dbForProject, Database $dbForPlatform, Document $project, Event $queueForEvents, Device $deviceForSites, Device $deviceForLocal, Build $queueForBuilds)
|
||||
{
|
||||
public function action(
|
||||
string $siteId,
|
||||
?string $installCommand,
|
||||
?string $buildCommand,
|
||||
?string $outputDirectory,
|
||||
mixed $code,
|
||||
mixed $activate,
|
||||
Request $request,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
Database $dbForPlatform,
|
||||
Document $project,
|
||||
Event $queueForEvents,
|
||||
Device $deviceForSites,
|
||||
Device $deviceForLocal,
|
||||
Build $queueForBuilds
|
||||
) {
|
||||
$activate = \strval($activate) === 'true' || \strval($activate) === '1';
|
||||
|
||||
$site = $dbForProject->getDocument('sites', $siteId);
|
||||
|
|
|
|||
|
|
@ -63,8 +63,15 @@ class Delete extends Action
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $siteId, string $deploymentId, Response $response, Database $dbForProject, DeleteEvent $queueForDeletes, Event $queueForEvents, Device $deviceForSites)
|
||||
{
|
||||
public function action(
|
||||
string $siteId,
|
||||
string $deploymentId,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
DeleteEvent $queueForDeletes,
|
||||
Event $queueForEvents,
|
||||
Device $deviceForSites
|
||||
) {
|
||||
$site = $dbForProject->getDocument('sites', $siteId);
|
||||
if ($site->isEmpty()) {
|
||||
throw new Exception(Exception::SITE_NOT_FOUND);
|
||||
|
|
|
|||
|
|
@ -62,8 +62,16 @@ class Get extends Action
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $siteId, string $deploymentId, string $type, Response $response, Request $request, Database $dbForProject, Device $deviceForSites, Device $deviceForBuilds)
|
||||
{
|
||||
public function action(
|
||||
string $siteId,
|
||||
string $deploymentId,
|
||||
string $type,
|
||||
Response $response,
|
||||
Request $request,
|
||||
Database $dbForProject,
|
||||
Device $deviceForSites,
|
||||
Device $deviceForBuilds
|
||||
) {
|
||||
$site = $dbForProject->getDocument('sites', $siteId);
|
||||
if ($site->isEmpty()) {
|
||||
throw new Exception(Exception::SITE_NOT_FOUND);
|
||||
|
|
|
|||
|
|
@ -65,8 +65,17 @@ class Create extends Action
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $siteId, string $deploymentId, Response $response, Document $project, Database $dbForProject, Database $dbForPlatform, Event $queueForEvents, Build $queueForBuilds, Device $deviceForSites)
|
||||
{
|
||||
public function action(
|
||||
string $siteId,
|
||||
string $deploymentId,
|
||||
Response $response,
|
||||
Document $project,
|
||||
Database $dbForProject,
|
||||
Database $dbForPlatform,
|
||||
Event $queueForEvents,
|
||||
Build $queueForBuilds,
|
||||
Device $deviceForSites
|
||||
) {
|
||||
$site = $dbForProject->getDocument('sites', $siteId);
|
||||
|
||||
if ($site->isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -59,8 +59,14 @@ class Update extends Action
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $siteId, string $deploymentId, Response $response, Database $dbForProject, Document $project, Event $queueForEvents)
|
||||
{
|
||||
public function action(
|
||||
string $siteId,
|
||||
string $deploymentId,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
Document $project,
|
||||
Event $queueForEvents
|
||||
) {
|
||||
$site = $dbForProject->getDocument('sites', $siteId);
|
||||
|
||||
if ($site->isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -79,8 +79,22 @@ class Create extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $siteId, string $repository, string $owner, string $rootDirectory, string $version, bool $activate, Request $request, Response $response, Database $dbForProject, Database $dbForPlatform, Document $project, Event $queueForEvents, Build $queueForBuilds, GitHub $github)
|
||||
{
|
||||
public function action(
|
||||
string $siteId,
|
||||
string $repository,
|
||||
string $owner,
|
||||
string $rootDirectory,
|
||||
string $version,
|
||||
bool $activate,
|
||||
Request $request,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
Database $dbForPlatform,
|
||||
Document $project,
|
||||
Event $queueForEvents,
|
||||
Build $queueForBuilds,
|
||||
GitHub $github
|
||||
) {
|
||||
$site = $dbForProject->getDocument('sites', $siteId);
|
||||
|
||||
if ($site->isEmpty()) {
|
||||
|
|
@ -111,8 +125,8 @@ class Create extends Base
|
|||
);
|
||||
|
||||
$queueForEvents
|
||||
->setParam('siteId', $site->getId())
|
||||
->setParam('deploymentId', $deployment->getId());
|
||||
->setParam('siteId', $site->getId())
|
||||
->setParam('deploymentId', $deployment->getId());
|
||||
|
||||
$response
|
||||
->setStatusCode(Response::STATUS_CODE_ACCEPTED)
|
||||
|
|
|
|||
|
|
@ -74,8 +74,20 @@ class Create extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $siteId, string $type, string $reference, bool $activate, Request $request, Response $response, Database $dbForProject, Database $dbForPlatform, Document $project, Event $queueForEvents, Build $queueForBuilds, GitHub $github)
|
||||
{
|
||||
public function action(
|
||||
string $siteId,
|
||||
string $type,
|
||||
string $reference,
|
||||
bool $activate,
|
||||
Request $request,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
Database $dbForPlatform,
|
||||
Document $project,
|
||||
Event $queueForEvents,
|
||||
Build $queueForBuilds,
|
||||
GitHub $github
|
||||
) {
|
||||
$site = $dbForProject->getDocument('sites', $siteId);
|
||||
|
||||
if ($site->isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -91,8 +91,30 @@ class Create extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $siteId, string $name, string $framework, bool $enabled, int $timeout, string $installCommand, string $buildCommand, string $outputDirectory, string $buildRuntime, string $adapter, string $installationId, string $fallbackFile, string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, string $specification, Response $response, Database $dbForProject, Document $project, Event $queueForEvents, Database $dbForPlatform)
|
||||
{
|
||||
public function action(
|
||||
string $siteId,
|
||||
string $name,
|
||||
string $framework,
|
||||
bool $enabled,
|
||||
int $timeout,
|
||||
string $installCommand,
|
||||
string $buildCommand,
|
||||
string $outputDirectory,
|
||||
string $buildRuntime,
|
||||
string $adapter,
|
||||
string $installationId,
|
||||
string $fallbackFile,
|
||||
string $providerRepositoryId,
|
||||
string $providerBranch,
|
||||
bool $providerSilentMode,
|
||||
string $providerRootDirectory,
|
||||
string $specification,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
Document $project,
|
||||
Event $queueForEvents,
|
||||
Database $dbForPlatform
|
||||
) {
|
||||
if (!empty($adapter)) {
|
||||
$configFramework = Config::getParam('frameworks')[$framework] ?? [];
|
||||
$adapters = \array_keys($configFramework['adapters'] ?? []);
|
||||
|
|
|
|||
|
|
@ -60,8 +60,13 @@ class Delete extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $siteId, Response $response, Database $dbForProject, DeleteEvent $queueForDeletes, Event $queueForEvents)
|
||||
{
|
||||
public function action(
|
||||
string $siteId,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
DeleteEvent $queueForDeletes,
|
||||
Event $queueForEvents
|
||||
) {
|
||||
$site = $dbForProject->getDocument('sites', $siteId);
|
||||
|
||||
if ($site->isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -61,8 +61,15 @@ class Update extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $siteId, string $deploymentId, Document $project, Response $response, Database $dbForProject, Event $queueForEvents, Database $dbForPlatform)
|
||||
{
|
||||
public function action(
|
||||
string $siteId,
|
||||
string $deploymentId,
|
||||
Document $project,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
Event $queueForEvents,
|
||||
Database $dbForPlatform
|
||||
) {
|
||||
$site = $dbForProject->getDocument('sites', $siteId);
|
||||
$deployment = $dbForProject->getDocument('deployments', $deploymentId);
|
||||
|
||||
|
|
|
|||
|
|
@ -55,8 +55,13 @@ class XList extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(array $frameworks, array $usecases, int $limit, int $offset, Response $response)
|
||||
{
|
||||
public function action(
|
||||
array $frameworks,
|
||||
array $usecases,
|
||||
int $limit,
|
||||
int $offset,
|
||||
Response $response
|
||||
) {
|
||||
$templates = Config::getParam('templates-site', []);
|
||||
|
||||
if (!empty($frameworks)) {
|
||||
|
|
|
|||
|
|
@ -57,8 +57,12 @@ class Get extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $siteId, string $range, Response $response, Database $dbForProject)
|
||||
{
|
||||
public function action(
|
||||
string $siteId,
|
||||
string $range,
|
||||
Response $response,
|
||||
Database $dbForProject
|
||||
) {
|
||||
$site = $dbForProject->getDocument('sites', $siteId);
|
||||
|
||||
if ($site->isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -60,8 +60,15 @@ class Update extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $siteId, string $variableId, string $key, ?string $value, ?bool $secret, Response $response, Database $dbForProject)
|
||||
{
|
||||
public function action(
|
||||
string $siteId,
|
||||
string $variableId,
|
||||
string $key,
|
||||
?string $value,
|
||||
?bool $secret,
|
||||
Response $response,
|
||||
Database $dbForProject
|
||||
) {
|
||||
$site = $dbForProject->getDocument('sites', $siteId);
|
||||
|
||||
if ($site->isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -55,8 +55,11 @@ class XList extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $siteId, Response $response, Database $dbForProject)
|
||||
{
|
||||
public function action(
|
||||
string $siteId,
|
||||
Response $response,
|
||||
Database $dbForProject
|
||||
) {
|
||||
$site = $dbForProject->getDocument('sites', $siteId);
|
||||
|
||||
if ($site->isEmpty()) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue