Completed
Push — master ( b8d297...c6cce1 )
by Maxence
02:13
created

SharesService   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 60
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 17 1
A new() 0 5 1
1
<?php
2
/**
3
 * Circles - Bring cloud-users closer together.
4
 *
5
 * This file is licensed under the Affero General Public License version 3 or
6
 * later. See the COPYING file.
7
 *
8
 * @author Maxence Lange <[email protected]>
9
 * @copyright 2017
10
 * @license GNU AGPL version 3 or any later version
11
 *
12
 * This program is free software: you can redistribute it and/or modify
13
 * it under the terms of the GNU Affero General Public License as
14
 * published by the Free Software Foundation, either version 3 of the
15
 * License, or (at your option) any later version.
16
 *
17
 * This program is distributed in the hope that it will be useful,
18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 * GNU Affero General Public License for more details.
21
 *
22
 * You should have received a copy of the GNU Affero General Public License
23
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
24
 *
25
 */
26
27
namespace OCA\Circles\Service;
28
29
30
use OCA\Circles\Db\CirclesMapper;
31
use OCA\Circles\Db\MembersMapper;
32
use OCP\IL10N;
33
use OCP\IUserManager;
34
35
class SharesService {
36
37
	/** @var string */
38
	private $userId;
39
40
	/** @var IL10N */
41
	private $l10n;
42
43
	/** @var IUserManager */
44
	private $userManager;
45
46
	/** @var ConfigService */
47
	private $configService;
48
49
	/** @var CirclesMapper */
50
	private $dbCircles;
51
52
	/** @var MembersMapper */
53
	private $dbMembers;
54
55
	/** @var MiscService */
56
	private $miscService;
57
58
59
	/**
60
	 * SharesService constructor.
61
	 *
62
	 * @param $userId
63
	 * @param IL10N $l10n
64
	 * @param IUserManager $userManager
65
	 * @param ConfigService $configService
66
	 * @param DatabaseService $databaseService
67
	 * @param MiscService $miscService
68
	 */
69
	public function __construct(
70
		$userId,
71
		IL10N $l10n,
72
		IUserManager $userManager,
73
		ConfigService $configService,
74
		DatabaseService $databaseService,
75
		MiscService $miscService
76
	) {
77
		$this->userId = $userId;
78
		$this->l10n = $l10n;
79
		$this->userManager = $userManager;
80
		$this->configService = $configService;
81
		$this->miscService = $miscService;
82
83
		$this->dbCircles = $databaseService->getCirclesMapper();
84
		$this->dbMembers = $databaseService->getMembersMapper();
85
	}
86
87
88
	public function new($circleId, $source, $type, $item) {
89
		$this->miscService->log("__" . $circleId . ' ' . $source . ' ' . $type . ' ' . json_encode($item));
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 100 characters; contains 101 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
90
91
		return true;
92
	}
93
94
}