Passed
Push — master ( c449d5...4361d6 )
by Morris
24:35 queued 12:21
created

SubscriptionCreatedEvent   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 36
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getSubscriptionData() 0 2 1
A __construct() 0 5 1
A getSubscriptionId() 0 2 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @copyright Copyright (c) 2020, Georg Ehrke
7
 *
8
 * @author Georg Ehrke <[email protected]>
9
 *
10
 * @license AGPL-3.0
11
 *
12
 * This code is free software: you can redistribute it and/or modify
13
 * it under the terms of the GNU Affero General Public License, version 3,
14
 * as published by the Free Software Foundation.
15
 *
16
 * This program is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
 * GNU Affero General Public License for more details.
20
 *
21
 * You should have received a copy of the GNU Affero General Public License, version 3,
22
 * along with this program. If not, see <http://www.gnu.org/licenses/>
23
 *
24
 */
25
namespace OCA\DAV\Events;
26
27
use OCP\EventDispatcher\Event;
28
29
/**
30
 * Class SubscriptionCreatedEvent
31
 *
32
 * @package OCA\DAV\Events
33
 * @since 20.0.0
34
 */
35
class SubscriptionCreatedEvent extends Event {
36
37
	/** @var int */
38
	private $subscriptionId;
39
40
	/** @var array */
41
	private $subscriptionData;
42
43
	/**
44
	 * SubscriptionCreatedEvent constructor.
45
	 *
46
	 * @param int $subscriptionId
47
	 * @param array $subscriptionData
48
	 * @since 20.0.0
49
	 */
50
	public function __construct(int $subscriptionId,
51
								array $subscriptionData) {
52
		parent::__construct();
53
		$this->subscriptionId = $subscriptionId;
54
		$this->subscriptionData = $subscriptionData;
55
	}
56
57
	/**
58
	 * @return int
59
	 * @since 20.0.0
60
	 */
61
	public function getSubscriptionId(): int {
62
		return $this->subscriptionId;
63
	}
64
65
	/**
66
	 * @return array
67
	 * @since 20.0.0
68
	 */
69
	public function getSubscriptionData(): array {
70
		return $this->subscriptionData;
71
	}
72
}
73