diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index a3efe5de5e..a474601453 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1216,6 +1216,7 @@ App::post('/v1/functions/:functionId/variables') 'functionId' => $function->getId(), 'key' => $key, 'value' => $value, + 'vars' => null ]); try { @@ -1283,8 +1284,8 @@ App::get('/v1/functions/:functionId/variables/:variableId') } $variable = $dbForProject->findOne('variables', [ - new Query('_uid', Query::TYPE_EQUAL, [$variableId]), - new Query('functionInternalId', Query::TYPE_EQUAL, [$function->getInternalId()]) + Query::equal('_uid', [$variableId]), + Query::equal('functionInternalId', [$function->getInternalId()]), ]); if ($variable === false || $variable->isEmpty()) { @@ -1323,8 +1324,8 @@ App::put('/v1/functions/:functionId/variables/:variableId') } $variable = $dbForProject->findOne('variables', [ - new Query('_uid', Query::TYPE_EQUAL, [$variableId]), - new Query('functionInternalId', Query::TYPE_EQUAL, [$function->getInternalId()]) + Query::equal('_uid', [$variableId]), + Query::equal('functionInternalId', [$function->getInternalId()]), ]); if ($variable === false || $variable->isEmpty()) { @@ -1369,8 +1370,8 @@ App::delete('/v1/functions/:functionId/variables/:variableId') } $variable = $dbForProject->findOne('variables', [ - new Query('_uid', Query::TYPE_EQUAL, [$variableId]), - new Query('functionInternalId', Query::TYPE_EQUAL, [$function->getInternalId()]) + Query::equal('_uid', [$variableId]), + Query::equal('functionInternalId', [$function->getInternalId()]), ]); if ($variable === false || $variable->isEmpty()) { diff --git a/app/init.php b/app/init.php index 51b692a7ac..de88bba0f0 100644 --- a/app/init.php +++ b/app/init.php @@ -399,7 +399,7 @@ Database::addFilter( function (mixed $value, Document $document, Database $database) { return $database ->find('variables', [ - new Query('functionInternalId', Query::TYPE_EQUAL, [$document->getInternalId()]), + Query::equal('functionInternalId', [$document->getInternalId()]), ], APP_LIMIT_SUBQUERY); } ); diff --git a/app/workers/deletes.php b/app/workers/deletes.php index fec9510408..6f9a3a8688 100644 --- a/app/workers/deletes.php +++ b/app/workers/deletes.php @@ -130,15 +130,15 @@ class DeletesV1 extends Worker protected function deleteCacheByResource(string $projectId): void { $this->deleteCacheFiles([ - new Query('resource', Query::TYPE_EQUAL, [$this->args['resource']]) - ]); + Query::equal('resource', [$this->args['resource']]), + ]); } protected function deleteCacheByTimestamp(): void { $this->deleteCacheFiles([ - new Query('accessedAt', Query::TYPE_LESSER, [$this->args['timestamp']]) - ]); + Query::lessThan('accessedAt', [$this->args['timestamp']]), + ]); } protected function deleteCacheFiles($query): void diff --git a/composer.lock b/composer.lock index 438e83bc58..70b02383e7 100644 --- a/composer.lock +++ b/composer.lock @@ -3526,23 +3526,23 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.15", + "version": "9.2.16", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f" + "reference": "2593003befdcc10db5e213f9f28814f5aa8ac073" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2e9da11878c4202f97915c1cb4bb1ca318a63f5f", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2593003befdcc10db5e213f9f28814f5aa8ac073", + "reference": "2593003befdcc10db5e213f9f28814f5aa8ac073", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.13.0", + "nikic/php-parser": "^4.14", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -3591,7 +3591,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.15" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.16" }, "funding": [ { @@ -3599,7 +3599,7 @@ "type": "github" } ], - "time": "2022-03-07T09:28:20+00:00" + "time": "2022-08-20T05:26:47+00:00" }, { "name": "phpunit/php-file-iterator",