Completed
Push — stable10 ( 36ab92...0b967a )
by
unknown
22s
created

Version20170808222334   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A run() 0 6 2
1
<?php
2
3
namespace OCA\Files_Antivirus\Migrations;
4
use OCA\Files_Antivirus\Db\RuleMapper;
5
use OCP\Migration\IOutput;
6
use OCP\Migration\ISimpleMigration;
7
8
/** Populate statuses */
9
class Version20170808222334 implements ISimpleMigration {
10
	private $ruleMapper;
11
	
12
	public function __construct(RuleMapper $ruleMapper){
13
		$this->ruleMapper = $ruleMapper;
14
	}
15
16
	public function run(IOutput $out) {
17
		$rules = $this->ruleMapper->findAll();
18
		if (!count($rules)) {
19
			$this->ruleMapper->populate();
20
		}
21
	}
22
}
23