Passed
Push — master ( 170c0d...3d1821 )
by Jean-Christophe
02:05
created

Toast   A

Complexity

Total Complexity 16

Size/Duplication

Total Lines 78
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 2
Metric Value
eloc 31
c 3
b 0
f 2
dl 0
loc 78
rs 10
wmc 16

16 Methods

Rating   Name   Duplication   Size   Complexity  
A close() 0 2 1
A __construct() 0 3 1
A setOnHide() 0 3 1
A setCloseOnClick() 0 3 1
A setTitle() 0 3 1
A setOnShow() 0 2 1
A setDisplayTime() 0 3 1
A setMessage() 0 3 1
A setOnApprove() 0 3 1
A setCloseIcon() 0 3 1
A setShowIcon() 0 3 1
A setClassProgress() 0 3 1
A setShowProgress() 0 3 1
A setOnDeny() 0 3 1
A setClass() 0 3 1
A setPosition() 0 3 1
1
<?php
2
3
namespace Ajax\semantic\components;
4
5
use Ajax\JsUtils;
6
7
/**
8
 * Ajax\semantic\components$Toast
9
 * This class is part of phpMv-ui
10
 * @author jcheron <[email protected]>
11
 * @version 1.0.0
12
 * @since 2.3.0
13
 * @see https://fomantic-ui.com/modules/toast.html
14
 */
15
class Toast extends SimpleSemExtComponent {
16
17
	public function __construct(JsUtils $js=NULL) {
18
		parent::__construct($js);
19
		$this->uiName='toast';
20
	}
21
22
	public function close(){
23
		return $this->addBehavior('close');
24
	}
25
26
	public function setClass($value){
27
		$this->params['class']=$value;
28
		return $this;
29
	}
30
	
31
	public function setCloseIcon(){
32
		$this->params['closeIcon']=true;
33
		return $this;
34
	}
35
	
36
	public function setShowIcon($value=false){
37
		$this->params['showIcon']=$value;
38
		return $this;
39
	}
40
	
41
	public function setCloseOnClick($value){
42
		$this->params['closeOnClick']=$value;
43
		return $this;
44
	}
45
	
46
	public function setTitle($title){
47
		$this->params['title']=$title;
48
		return $this;
49
	}
50
	
51
	public function setMessage($message){
52
		$this->params['message']=$message;
53
		return $this;
54
	}
55
	
56
	public function setPosition($position){
57
		$this->params['position']=$position;
58
		return $this;
59
	}
60
	
61
	public function setDisplayTime($time){
62
		$this->params['displayTime']=$time;
63
		return $this;
64
	}
65
	
66
	public function setShowProgress($value='top'){
67
		$this->params['showProgress']=$value;
68
		return $this;
69
	}
70
	
71
	public function setClassProgress($value){
72
		$this->params['classProgress']=$value;
73
		return $this;
74
	}
75
76
	public function setOnShow($jsCode) {
77
		$this->addComponentEvent('onShow', $jsCode);
78
	}
79
	
80
	public function setOnHide($jsCode) {
81
		$this->addComponentEvent('onHide', $jsCode);
82
		return $this;
83
	}
84
	
85
	public function setOnApprove($jsCode) {
86
		$this->addComponentEvent('onApprove', $jsCode);
87
		return $this;
88
	}
89
	
90
	public function setOnDeny($jsCode) {
91
		$this->addComponentEvent('onDeny', $jsCode);
92
		return $this;
93
	}
94
}
95