Skip to content

Commit f8178ae

Browse files
authored
[11.12] Passing parameters to removeVariable method (#757)
* Passing parameters to removeVariable method * Update Projects.php * Update Projects.php * Update Projects.php added resolver + docs * Update Projects.php add filter level to params * Update Projects.php * Update Projects.php conding style * Update Projects.php coding style
1 parent 35c831f commit f8178ae

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/Api/Projects.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,14 +1288,24 @@ public function updateVariable($project_id, string $key, string $value, ?bool $p
12881288
}
12891289

12901290
/**
1291-
* @param int|string $project_id
1292-
* @param string $key
1291+
* @param int|string $project_id
1292+
* @param string $key
1293+
* @param array<string, mixed> $parameters {
1294+
*
1295+
* @var array $filter {
1296+
*
1297+
* @var string $environment_scope Use filter[environment_scope] to select the variable with the matching environment_scope attribute.
1298+
* }
1299+
* }
12931300
*
12941301
* @return mixed
12951302
*/
1296-
public function removeVariable($project_id, string $key)
1303+
public function removeVariable($project_id, string $key, array $parameters = [])
12971304
{
1298-
return $this->delete($this->getProjectPath($project_id, 'variables/'.self::encodePath($key)));
1305+
$resolver = new OptionsResolver();
1306+
$resolver->setDefined('filter')
1307+
->setAllowedTypes('filter', 'array');
1308+
return $this->delete($this->getProjectPath($project_id, 'variables/'.self::encodePath($key)), $resolver->resolve($parameters));
12991309
}
13001310

13011311
/**

0 commit comments

Comments
 (0)