Passed
Push — master ( 2da96f...f3a9cc )
by Matias
13:54
created

Requirements   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 62.5%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 14
ccs 5
cts 8
cp 0.625
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A pdlibLoaded() 0 2 1
A memoriesIsInstalled() 0 3 1
A hasEnoughMemory() 0 3 1
1
<?php
2
namespace OCA\FaceRecognition\Helper;
3
4
use OCP\App\IAppManager;
5
6
use OCA\FaceRecognition\Helper\MemoryLimits;
7
8
use OCA\FaceRecognition\Service\SettingsService;
9
10
class Requirements
11
{
12 1
	public static function hasEnoughMemory(): bool {
13 1
		$memory = MemoryLimits::getSystemMemory();
14 1
		return ($memory > SettingsService::MINIMUM_SYSTEM_MEMORY_REQUIREMENTS);
15
	}
16
17 1
	public static function pdlibLoaded(): bool {
18 1
		return extension_loaded('pdlib');
19
	}
20
21
	public static function memoriesIsInstalled(): bool {
22
		$appManager = \OC::$server->get(IAppManager::class);
23
		return $appManager->isEnabledForUser('memories');
24
	}
25
26
}
27