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

Version20170808222334::run()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
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