Completed
Push — master ( 8950f9...87c90f )
by
unknown
27:18
created
apps/dav/lib/BackgroundJob/OutOfOfficeEventDispatcherJob.php 2 patches
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -21,55 +21,55 @@
 block discarded – undo
21 21
 use Psr\Log\LoggerInterface;
22 22
 
23 23
 class OutOfOfficeEventDispatcherJob extends QueuedJob {
24
-	public const EVENT_START = 'start';
25
-	public const EVENT_END = 'end';
24
+    public const EVENT_START = 'start';
25
+    public const EVENT_END = 'end';
26 26
 
27
-	public function __construct(
28
-		ITimeFactory $time,
29
-		private AbsenceMapper $absenceMapper,
30
-		private LoggerInterface $logger,
31
-		private IEventDispatcher $eventDispatcher,
32
-		private IUserManager $userManager,
33
-		private TimezoneService $timezoneService,
34
-	) {
35
-		parent::__construct($time);
36
-	}
27
+    public function __construct(
28
+        ITimeFactory $time,
29
+        private AbsenceMapper $absenceMapper,
30
+        private LoggerInterface $logger,
31
+        private IEventDispatcher $eventDispatcher,
32
+        private IUserManager $userManager,
33
+        private TimezoneService $timezoneService,
34
+    ) {
35
+        parent::__construct($time);
36
+    }
37 37
 
38
-	public function run($argument): void {
39
-		$id = $argument['id'];
40
-		$event = $argument['event'];
38
+    public function run($argument): void {
39
+        $id = $argument['id'];
40
+        $event = $argument['event'];
41 41
 
42
-		try {
43
-			$absence = $this->absenceMapper->findById($id);
44
-		} catch (DoesNotExistException $e) {
45
-			$this->logger->error('Failed to dispatch out-of-office event: ' . $e->getMessage(), [
46
-				'exception' => $e,
47
-				'argument' => $argument,
48
-			]);
49
-			return;
50
-		}
42
+        try {
43
+            $absence = $this->absenceMapper->findById($id);
44
+        } catch (DoesNotExistException $e) {
45
+            $this->logger->error('Failed to dispatch out-of-office event: ' . $e->getMessage(), [
46
+                'exception' => $e,
47
+                'argument' => $argument,
48
+            ]);
49
+            return;
50
+        }
51 51
 
52
-		$userId = $absence->getUserId();
53
-		$user = $this->userManager->get($userId);
54
-		if ($user === null) {
55
-			$this->logger->error("Failed to dispatch out-of-office event: User $userId does not exist", [
56
-				'argument' => $argument,
57
-			]);
58
-			return;
59
-		}
52
+        $userId = $absence->getUserId();
53
+        $user = $this->userManager->get($userId);
54
+        if ($user === null) {
55
+            $this->logger->error("Failed to dispatch out-of-office event: User $userId does not exist", [
56
+                'argument' => $argument,
57
+            ]);
58
+            return;
59
+        }
60 60
 
61
-		$data = $absence->toOutOufOfficeData(
62
-			$user,
63
-			$this->timezoneService->getUserTimezone($userId) ?? $this->timezoneService->getDefaultTimezone(),
64
-		);
65
-		if ($event === self::EVENT_START) {
66
-			$this->eventDispatcher->dispatchTyped(new OutOfOfficeStartedEvent($data));
67
-		} elseif ($event === self::EVENT_END) {
68
-			$this->eventDispatcher->dispatchTyped(new OutOfOfficeEndedEvent($data));
69
-		} else {
70
-			$this->logger->error("Invalid out-of-office event: $event", [
71
-				'argument' => $argument,
72
-			]);
73
-		}
74
-	}
61
+        $data = $absence->toOutOufOfficeData(
62
+            $user,
63
+            $this->timezoneService->getUserTimezone($userId) ?? $this->timezoneService->getDefaultTimezone(),
64
+        );
65
+        if ($event === self::EVENT_START) {
66
+            $this->eventDispatcher->dispatchTyped(new OutOfOfficeStartedEvent($data));
67
+        } elseif ($event === self::EVENT_END) {
68
+            $this->eventDispatcher->dispatchTyped(new OutOfOfficeEndedEvent($data));
69
+        } else {
70
+            $this->logger->error("Invalid out-of-office event: $event", [
71
+                'argument' => $argument,
72
+            ]);
73
+        }
74
+    }
75 75
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
 		try {
43 43
 			$absence = $this->absenceMapper->findById($id);
44 44
 		} catch (DoesNotExistException $e) {
45
-			$this->logger->error('Failed to dispatch out-of-office event: ' . $e->getMessage(), [
45
+			$this->logger->error('Failed to dispatch out-of-office event: '.$e->getMessage(), [
46 46
 				'exception' => $e,
47 47
 				'argument' => $argument,
48 48
 			]);
Please login to merge, or discard this patch.