for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace TestMonitor\DoneDone\Actions;
use TestMonitor\DoneDone\Resources\Task;
use TestMonitor\DoneDone\Transforms\TransformsTasks;
trait ManagesTasks
{
use TransformsTasks;
/**
* Get a list of of tasks.
*
* @param int $accountId
* @param int $projectId
* @param int $page
* @return Task[]
*/
public function tasks(int $accountId, int $projectId, int $page = 1): array
$result = $this->get("{$accountId}/internal-projects/{$projectId}/tasks", ['page' => $page]);
get()
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
/** @scrutinizer ignore-call */
return array_map(function ($task) {
return $this->fromDoneDoneTask($task);
}, $result['listTasks']);
}
* Get a single task.
* @param int $id
* @return Task
public function task(int $id, int $accountId, int $projectId): Task
$result = $this->get("{$accountId}/internal-projects/{$projectId}/tasks/{$id}");
return $this->fromDoneDoneTask($result);
* Create a new task.
* @param \TestMonitor\DoneDone\Resources\Task $task
public function createTask(Task $task, int $accountId, int $projectId)
$result = $this->post("{$accountId}/internal-projects/{$projectId}/tasks/", [
post()
'json' => $this->toDoneDoneTask($task),
]);
return $this->task($result['id'], $accountId, $projectId);