Passed
Push — master ( 2fd7fe...f5932e )
by Robin
14:46 queued 13s
created

EventSourceFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 2
rs 10
1
<?php
2
/**
3
 * @copyright Copyright (c) 2023 Daniel Kesselberg <[email protected]>
4
 *
5
 * @author Daniel Kesselberg <[email protected]>
6
 *
7
 * @license AGPL-3.0-or-later
8
 *
9
 * This code is free software: you can redistribute it and/or modify
10
 * it under the terms of the GNU Affero General Public License, version 3,
11
 * as published by the Free Software Foundation.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
 * GNU Affero General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Affero General Public License, version 3,
19
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
20
 *
21
 */
22
23
namespace OC;
24
25
use OCP\IEventSource;
26
use OCP\IEventSourceFactory;
27
use OCP\IRequest;
28
29
class EventSourceFactory implements IEventSourceFactory {
30
	private IRequest $request;
31
32
33
	public function __construct(IRequest $request) {
34
		$this->request = $request;
35
	}
36
37
	/**
38
	 * Create a new event source
39
	 *
40
	 * @return IEventSource
41
	 * @since 28.0.0
42
	 */
43
	public function create(): IEventSource {
44
		return new \OC_EventSource($this->request);
45
	}
46
}
47