Failed Conditions
Push — master ( 5433f0...117895 )
by Alexander
01:52
created

ChangeLogIssueCloner::isLinkAccepted()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 2
1
<?php
2
/**
3
 * This file is part of the Jira-CLI library.
4
 * For the full copyright and license information, please view
5
 * the LICENSE file that was distributed with this source code.
6
 *
7
 * @copyright Alexander Obuhovich <[email protected]>
8
 * @link      https://github.com/console-helpers/jira-cli
9
 */
10
11
namespace ConsoleHelpers\JiraCLI\Issue;
12
13
14
use chobie\Jira\Api;
15
use chobie\Jira\Issue;
16
17
class ChangeLogIssueCloner extends IssueCloner
18
{
19
20
	/**
21
	 * IssueCloner constructor.
22
	 *
23
	 * @param Api $jira_api Jira REST client.
24
	 */
25
	public function __construct(Api $jira_api)
26
	{
27
		parent::__construct($jira_api);
28
29
		$this->queryFields[] = 'project';
30
		$this->queryFields[] = 'type';
31
	}
32
33
	/**
34
	 * Determines if link is accepted.
35
	 *
36
	 * @param Issue $issue        Issue.
37
	 * @param Issue $linked_issue Linked issue.
38
	 *
39
	 * @return boolean
40
	 */
41
	protected function isLinkAccepted(Issue $issue, Issue $linked_issue)
42
	{
43
		$issue_type = $linked_issue->get('issuetype');
44
45
		return $issue_type['id'] === $this->getChangelogEntryIssueTypeId();
46
	}
47
48
}
49