Completed
Push — master ( 6247cb...136da8 )
by Maxence
19s queued 11s
created

CircleMemberRequestedEvent   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 37
loc 37
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 3 3 1
A setType() 5 5 1
A getType() 3 3 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
declare(strict_types=1);
4
5
6
/**
7
 * Circles - Bring cloud-users closer together.
8
 *
9
 * This file is licensed under the Affero General Public License version 3 or
10
 * later. See the COPYING file.
11
 *
12
 * @author Maxence Lange <[email protected]>
13
 * @copyright 2021
14
 * @license GNU AGPL version 3 or any later version
15
 *
16
 * This program is free software: you can redistribute it and/or modify
17
 * it under the terms of the GNU Affero General Public License as
18
 * published by the Free Software Foundation, either version 3 of the
19
 * License, or (at your option) any later version.
20
 *
21
 * This program is distributed in the hope that it will be useful,
22
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24
 * GNU Affero General Public License for more details.
25
 *
26
 * You should have received a copy of the GNU Affero General Public License
27
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
28
 *
29
 */
30
31
32
namespace OCA\Circles\Events;
33
34
35
use OCA\Circles\Model\Federated\FederatedEvent;
36
37
38
/**
39
 * Class CircleMemberRequestedEvent
40
 *
41
 * This Event is called when it has been confirmed that a Member's request/invitation is done on all instances
42
 * used by the Circle.
43
 * Meaning that the event won't be triggered until each instances have been once available during the
44
 * retry-on-fail initiated in a background job
45
 *
46
 * WARNING: Unlike RequestingCircleMemberEvent, this Event is only called on the master instance of the Circle.
47
 *
48
 * @package OCA\Circles\Events
49
 */
50 View Code Duplication
class CircleMemberRequestedEvent extends CircleResultGenericEvent {
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
51
52
53
	/** @var int */
54
	private $type = 0;
55
56
57
	/**
58
	 * CircleMemberRequestedEvent constructor.
59
	 *
60
	 * @param FederatedEvent $federatedEvent
61
	 * @param array $results
62
	 */
63
	public function __construct(FederatedEvent $federatedEvent, array $results) {
64
		parent::__construct($federatedEvent, $results);
65
	}
66
67
68
	/**
69
	 * @param int $type
70
	 *
71
	 * @return $this
72
	 */
73
	public function setType(int $type): self {
74
		$this->type = $type;
75
76
		return $this;
77
	}
78
79
	/**
80
	 * @return int
81
	 */
82
	public function getType(): int {
83
		return $this->type;
84
	}
85
86
}
87
88