Code Duplication    Length = 9-14 lines in 3 locations

lib/WOPI/DiscoveryManager.php 1 location

@@ 51-64 (lines=14) @@
48
	 * @param IL10N $l10n
49
	 * @param ITimeFactory $timeFactory
50
	 */
51
	public function __construct(IClientService $clientService,
52
								IAppData $appData,
53
								IConfig $config,
54
								IL10N $l10n,
55
								ITimeFactory $timeFactory) {
56
		$this->clientService = $clientService;
57
		try {
58
			$this->appData = $appData->getFolder('richdocuments');
59
		} catch (NotFoundException $e) {
60
			$this->appData = $appData->newFolder('richdocuments');
61
		}
62
		$this->config = $config;
63
		$this->timeFactory = $timeFactory;
64
	}
65
66
	public function get() {
67
		// First check if there is a local valid discovery file

lib/Service/CapabilitiesService.php 1 location

@@ 44-52 (lines=9) @@
41
	/** @var array */
42
	private $capabilities;
43
44
	public function __construct(IConfig $config, IClientService $clientService, IAppData $appData) {
45
		$this->config = $config;
46
		$this->clientService = $clientService;
47
		try {
48
			$this->appData = $appData->getFolder('richdocuments');
49
		} catch (NotFoundException $e) {
50
			$this->appData = $appData->newFolder('richdocuments');
51
		}
52
	}
53
54
55
	public function getCapabilities() {

lib/Capabilities.php 1 location

@@ 93-101 (lines=9) @@
90
	 * @param IAppData $appData
91
	 * @throws \OCP\Files\NotPermittedException
92
	 */
93
	public function __construct(IAppData $appData, IL10N $l10n, AppConfig $config) {
94
		$this->l10n = $l10n;
95
		$this->config = $config;
96
		try {
97
			$this->appData = $appData->getFolder('richdocuments');
98
		} catch (NotFoundException $e) {
99
			$this->appData = $appData->newFolder('richdocuments');
100
		}
101
	}
102
103
	public function getCapabilities() {
104
		$collaboraCapabilities = $this->getCollaboraCapabilities();