Skip to content

Commit f1d4d41

Browse files
committed
Refactor remove method to accept parameters as an array in Projects.php
1 parent 0de51e9 commit f1d4d41

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

src/Api/Projects.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -194,17 +194,9 @@ public function update(int|string $project_id, array $parameters): mixed
194194
return $this->put('projects/'.self::encodePath($project_id), $parameters);
195195
}
196196

197-
public function remove(int|string $project_id, bool $permanent = false, string $fullPath = ''): mixed
198-
{
199-
$params = [];
200-
if ($permanent) {
201-
$params = [
202-
'permanently_remove' => true,
203-
'full_path' => $fullPath,
204-
];
205-
}
206-
207-
return $this->delete('projects/'.self::encodePath($project_id), $params);
197+
public function remove(int|string $project_id, array $parameters = []): mixed
198+
{
199+
return $this->delete('projects/'.self::encodePath($project_id), $parameters);
208200
}
209201

210202
public function restore(int|string $project_id): mixed

tests/Api/ProjectsTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,10 @@ public function shouldRemoveProjectPermanently(): void
356356
->with('projects/1', ['permanently_remove' => true, 'full_path' => 'full/path/to/project'])
357357
->willReturn(true);
358358

359-
$this->assertEquals($expectedBool, $api->remove(1, true, 'full/path/to/project'));
359+
$this->assertEquals($expectedBool, $api->remove(1, [
360+
'permanently_remove' => true,
361+
'full_path' => 'full/path/to/project',
362+
]));
360363
}
361364

362365
#[Test]

0 commit comments

Comments
 (0)