Passed
Push — master ( 5c767a...47de24 )
by Jean-Christophe
06:45
created

CustomRule::compile()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 2
rs 10
1
<?php
2
namespace Ajax\semantic\components\validation;
3
4
use Ajax\JsUtils;
5
6
/**
7
 * Ajax\semantic\components\validation$CustomRule
8
 * This class is part of phpmv-ui
9
 *
10
 * @author jc
11
 * @version 1.0.0
12
 *
13
 */
14
class CustomRule extends Rule {
15
16
	protected $jsFunction;
17
18
	public function __construct($type, $jsFunction, $prompt = NULL, $value = NULL) {
19
		parent::__construct($type, $prompt, $value);
20
		$this->jsFunction = $jsFunction;
21
	}
22
23
	public function compile(JsUtils $js) {
24
		$js->exec(Rule::custom($this->getType(), $this->jsFunction), true);
25
	}
26
}