1 | <?php |
||
15 | class ExternalLibraryBitBucketService implements JiraTicketMappedEventAware, BitBucketService |
||
16 | { |
||
17 | /** @var string */ |
||
18 | private const URL_PREFIX = 'https://farpoint.get-ag.com/jira/rest/dev-status/1.0/issue/detail?issueId='; |
||
19 | |||
20 | /** @var string */ |
||
21 | private const URL_SUFFIX = '&applicationType=stash&dataType=pullrequest'; |
||
22 | |||
23 | /** @var string */ |
||
24 | private $url; |
||
25 | |||
26 | /** @var LoggerInterface */ |
||
27 | private $logger; |
||
28 | |||
29 | /** @var ExternalLibraryHttpClient */ |
||
30 | private $httpClient; |
||
31 | |||
32 | /** @var EventDispatcherInterface */ |
||
33 | private $dispatcher; |
||
34 | |||
35 | 1 | public function __construct( |
|
44 | |||
45 | /** Recives event with mapped Jira ticket. */ |
||
46 | 1 | public function onJiraTicketMapped(JiraTicketMappedEvent $event) : void |
|
52 | |||
53 | /** |
||
54 | * Fetches data from BitBucket by tickets id. |
||
55 | */ |
||
56 | 1 | public function fetchBitBucketData(int $ticketId) : void |
|
66 | |||
67 | /** |
||
68 | * Maps and filters received BitBucket data to array. |
||
69 | */ |
||
70 | 1 | private function mapToBitbucketTicket(array $bbTicket, int $ticketId) : void |
|
82 | |||
83 | /** |
||
84 | * Combines url with given ticket id. |
||
85 | */ |
||
86 | 1 | private function createUrl(int $ticketId) : void |
|
90 | } |
||
91 |