Passed
Push — master ( c653a4...a7d880 )
by Jean-Christophe
02:17
created

Animation   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 77
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 39
dl 0
loc 77
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getScript() 0 1 1
A setQueue() 0 2 1
A setEasing() 0 34 1
A setDuration() 0 2 1
A __construct() 0 4 1
1
<?php
2
namespace Ajax\ui\properties;
3
4
use Ajax\common\components\BaseComponent;
5
6
/**
7
 * Composant JQuery UI Animation property
8
 *
9
 * @author jc
10
 * @version 1.001
11
 */
12
class Animation extends BaseComponent {
13
14
	public function __construct($duration = 400, $easing = "swing", $queue = false) {
15
		$this->setDuration($duration);
16
		$this->setEasing($easing);
17
		$this->setQueue($queue);
18
	}
19
20
	/**
21
	 * An int determining how long the animation will run (in milliseconds).
22
	 *
23
	 * @param int $value
24
	 *        	default : 400
25
	 */
26
	public function setDuration($value) {
27
		$this->setParamCtrl("duration", $value, "is_int");
28
	}
29
30
	/**
31
	 * A string indicating which easing function to use for the transition.
32
	 *
33
	 * @param string $value
34
	 *        	default : swing
35
	 */
36
	public function setEasing($value) {
37
		$this->setParamCtrl("easing", $value, array(
38
			"linear",
39
			"swing",
40
			"easeInQuad",
41
			"easeOutQuad",
42
			"easeInOutQuad",
43
			"easeInCubic",
44
			"easeOutCubic",
45
			"easeInOutCubic",
46
			"easeInQuart",
47
			"easeOutQuart",
48
			"easeInOutQuart",
49
			"easeInQuint",
50
			"easeOutQuint",
51
			"easeInOutQuint",
52
			"easeInExpo",
53
			"easeOutExpo",
54
			"easeInOutExpo",
55
			"easeInSine",
56
			"easeOutSine",
57
			"easeInOutSine",
58
			"easeInCirc",
59
			"easeOutCirc",
60
			"easeInOutCirc",
61
			"easeInElastic",
62
			"easeOutElastic",
63
			"easeInOutElastic",
64
			"easeInBack",
65
			"easeOutBack",
66
			"easeInOutBack",
67
			"easeInBounce",
68
			"easeOutBounce",
69
			"easeInOutBounce"
70
		));
71
	}
72
73
	/**
74
	 * A Boolean indicating whether to place the animation in the effects queue.
75
	 * If false, the animation will begin immediately.
76
	 *
77
	 * @param Boolean $value
78
	 *        	default : true
79
	 */
80
	public function setQueue($value) {
81
		$this->setParamCtrl("queue", $value, "is_bool");
82
	}
83
84
	/*
85
	 * (non-PHPdoc)
86
	 * @see \Ajax\common\BaseComponent::getScript()
87
	 */
88
	public function getScript() {}
89
}
90