Failed Conditions
Push — master ( 4f9353...7eeb29 )
by Michel
02:37
created

Api::addWorkLogEntry()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 5
1
<?php
2
declare(strict_types=1);
3
4
namespace TogglJira\Jira;
5
6
use chobie\Jira\Api as BaseApi;
7
8
class Api extends BaseApi
9
{
10
    /**
11
     * @param string $issueID
12
     * @param int $seconds
13
     * @param string $userID
14
     * @param string $comment
15
     * @param string $created
16
     * @return array|BaseApi\Result|false
17
     */
18
    public function addWorkLogEntry(
19
        string $issueID,
20
        int $seconds,
21
        string $userID,
22
        string $comment,
23
        string $created
24
    ) {
25
        $params = [
26
            'author' => [
27
                'accountId' => $userID,
28
            ],
29
            'created' => $created,
30
            'timeSpentSeconds' => $seconds,
31
            'comment' => $comment
32
        ];
33
34
        return $this->api(self::REQUEST_POST, "/rest/api/2/issue/{$issueID}/worklog?adjustEstimate=auto", $params);
35
    }
36
}
37