footer::set_attributes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 6
ccs 3
cts 3
cp 1
crap 1
rs 9.4285
1
<?php
2
/**
3
 * UIX Footer
4
 *
5
 * @package   ui
6
 * @author    David Cramer
7
 * @license   GPL-2.0+
8
 * @link
9
 * @copyright 2016 David Cramer
10
 */
11
namespace uix\ui;
12
13
/**
14
 * Footer type used for creating footer based sections. Mainly used in modals and pages
15
 *
16
 * @package uix\ui
17
 * @author  David Cramer
18
 */
19
class footer extends section {
20
21
	/**
22
	 * The type of object
23
	 *
24
	 * @since 1.0.0
25
	 * @access public
26
	 * @var      string
27
	 */
28
	public $type = 'footer';
29
30
31
	/**
32
	 * Sets the wrappers attributes
33
	 *
34
	 * @since 1.0.0
35
	 * @access public
36
	 */
37
	public function set_attributes() {
38
39 1
		$this->attributes['class'][] = 'uix-' . esc_attr( $this->type );
40
41 1
		parent::set_attributes();
42 1
	}
43 1
44 1
	/**
45 1
	 * Render the Control
46
	 *
47
	 * @since 1.0.0
48 1
	 * @see \uix\ui\uix
49
	 * @access public
50
	 * @return string HTML of rendered box
51
	 */
52
	public function render() {
53
54
		$output = $this->render_template();
55
		if ( ! empty( $this->child ) ) {
56
			$output .= '<div ' . $this->build_attributes() . '>';
57
			$output .= $this->render_children();
58
			$output .= '</div>';
59
		}
60
61
		return $output;
62
	}
63
64
}
65