@@ -41,7 +41,7 @@ |
||
| 41 | 41 | $messageDto->data['needle'], |
| 42 | 42 | $messageDto->data['description'], |
| 43 | 43 | new \DateTime($messageDto->data['created']), |
| 44 | - (int) $messageDto->data['duration'] |
|
| 44 | + (int)$messageDto->data['duration'] |
|
| 45 | 45 | ); |
| 46 | 46 | } |
| 47 | 47 | } |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | $_ENV['JIRA_USER'], |
| 27 | 27 | true, |
| 28 | 28 | $_ENV['JIRA_TOKEN'], |
| 29 | - (int) $_ENV['JIRA_MAX_RESULTS'], |
|
| 29 | + (int)$_ENV['JIRA_MAX_RESULTS'], |
|
| 30 | 30 | $_ENV['JIRA_QUERY'], |
| 31 | 31 | ); |
| 32 | 32 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | public function collect(): PromiseInterface |
| 25 | 25 | { |
| 26 | 26 | $wrapPromise = new Promise( |
| 27 | - function () use (&$wrapPromise) { |
|
| 27 | + function() use (&$wrapPromise) { |
|
| 28 | 28 | $periodicalActivity = $this->getFacade()->generateActivityToDate(date('Y-m-d 00:00')); |
| 29 | 29 | $wrapPromise->resolve($periodicalActivity); |
| 30 | 30 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | return $this->getFacade() |
| 42 | 42 | ->getChannel($this->channelFilterCollection) |
| 43 | 43 | ->then( |
| 44 | - function (array $channels) { |
|
| 44 | + function(array $channels) { |
|
| 45 | 45 | $postPromises = []; |
| 46 | 46 | foreach ($channels as $channel) { |
| 47 | 47 | $postPromises[] = $this->getFacade()->getPosts( |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $activityDtoArray[$ticketNr] = new ActivityDto( |
| 85 | 85 | $ticketNr, |
| 86 | 86 | sprintf('%s: %s', self::POST_SUFFIX, $ticketNr), |
| 87 | - new \DateTime(date('d-m-Y', (int) ($post['create_at'] / 1000))), |
|
| 87 | + new \DateTime(date('d-m-Y', (int)($post['create_at'] / 1000))), |
|
| 88 | 88 | $duration |
| 89 | 89 | ); |
| 90 | 90 | } |
@@ -96,8 +96,8 @@ discard block |
||
| 96 | 96 | { |
| 97 | 97 | $matchPattern = sprintf('(%s-[0-9]{1,})i', $_ENV['MATTERMOST_PATTERN']); |
| 98 | 98 | $resultMatch = preg_match($matchPattern, $target_title, $match); |
| 99 | - if (0 === $resultMatch || ! isset($match[0])) { |
|
| 100 | - throw new \Exception('needle not found for target_title: '.$target_title); |
|
| 99 | + if (0 === $resultMatch || !isset($match[0])) { |
|
| 100 | + throw new \Exception('needle not found for target_title: ' . $target_title); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | return strtoupper($match[0]); |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | { |
| 108 | 108 | $matchPattern = sprintf('(%s-[0-9]{1,})i', $_ENV['MATTERMOST_PATTERN']); |
| 109 | 109 | $resultMatch = preg_match($matchPattern, $target_title, $match); |
| 110 | - if (0 === $resultMatch || ! isset($match[0])) { |
|
| 110 | + if (0 === $resultMatch || !isset($match[0])) { |
|
| 111 | 111 | return false; |
| 112 | 112 | } |
| 113 | 113 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | private string $projektronCookieHeaderValue, |
| 24 | 24 | private string $username, |
| 25 | 25 | private string $catchAllTask |
| 26 | - ) { $this->setCsrfFromCookie(); } |
|
| 26 | + ) { $this->setCsrfFromCookie(); } |
|
| 27 | 27 | |
| 28 | 28 | public function writeActivities(ActivityDtoCollection $activityDtoCollection): int |
| 29 | 29 | { |
@@ -34,13 +34,13 @@ discard block |
||
| 34 | 34 | $activityDto->created->setTime(22, 0, 0); // projektron doesnt save the entry if the time is not 22:00 HAHAHA |
| 35 | 35 | $payloadDto = new PayloadDto( |
| 36 | 36 | $activityDto->needle, |
| 37 | - $this->csrf,$this->username, |
|
| 38 | - $activityDto->created->getTimestamp().'000', |
|
| 37 | + $this->csrf, $this->username, |
|
| 38 | + $activityDto->created->getTimestamp() . '000', |
|
| 39 | 39 | (string)intdiv($activityDto->duration, 60), |
| 40 | - (string)($activityDto->duration%60), |
|
| 40 | + (string)($activityDto->duration % 60), |
|
| 41 | 41 | $activityDto->description |
| 42 | 42 | ); |
| 43 | - $this->sendActivity($this->projektronApiEndpoint.'?oid='.$activityDto->needle, $payloadDto); |
|
| 43 | + $this->sendActivity($this->projektronApiEndpoint . '?oid=' . $activityDto->needle, $payloadDto); |
|
| 44 | 44 | ++$savedActivities; |
| 45 | 45 | } |
| 46 | 46 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | private function sendActivity(string $path, PayloadDto $payloadDto): string |
| 51 | 51 | { |
| 52 | 52 | $this->headers = [ |
| 53 | - 'Cookie: '.$this->projektronCookieHeaderValue, |
|
| 53 | + 'Cookie: ' . $this->projektronCookieHeaderValue, |
|
| 54 | 54 | 'User-Agent: ArchUser/1337', |
| 55 | 55 | ]; |
| 56 | 56 | |