Completed
Push — master ( 552173...c8702c )
by Tobias
12:00 queued 43s
created

Accordion   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 1
dl 0
loc 21
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A placeMe() 0 14 1
1
<?php
2
/**
3
 * Contains the component class for rendering an Accordion.
4
 *
5
 * @copyright (C) 2018, Tobias Oetterer, Paderborn University
6
 * @license       https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License, version 3 (or later)
7
 *
8
 * This file is part of the MediaWiki extension BootstrapComponents.
9
 * The BootstrapComponents extension is free software: you can redistribute it
10
 * and/or modify it under the terms of the GNU General Public License as published
11
 * by the Free Software Foundation, either version 3 of the License, or
12
 * (at your option) any later version.
13
 *
14
 * The BootstrapComponents extension is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
21
 *
22
 * @file
23
 * @ingroup       BootstrapComponents
24
 * @author        Tobias Oetterer
25
 */
26
27
namespace BootstrapComponents\Components;
28
29
use BootstrapComponents\AbstractComponent;
30
use \Html;
31
32
/**
33
 * Class Accordion
34
 *
35
 * Class for component 'accordion'
36
 *
37
 * @see   https://github.com/oetterer/BootstrapComponents/blob/master/docs/components.md#Accordion
38
 * @since 1.0
39
 */
40
class Accordion extends AbstractComponent {
41
	/**
42
	 * @inheritdoc
43
	 *
44
	 * @param string $input
45
	 */
46 3
	public function placeMe( $input ) {
47
48 3
		list ( $class, $style ) = $this->processCss( 'panel-group', [] );
49
50 3
		return Html::rawElement(
51 3
			'div',
52
			[
53 3
				'class' => $this->arrayToString( $class, ' ' ),
54 3
				'style' => $this->arrayToString( $style, ';' ),
55 3
				'id'    => $this->getId(),
56 3
			],
57
			$input
58 3
		);
59
	}
60
}