Completed
Push — master ( fd21a5...c0e997 )
by WEBEWEB
17:11
created

ButtonRenderer   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 25
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A renderCircle() 0 15 3
1
<?php
2
3
/*
4
 * This file is part of the adminbsb-material-design-bundle package.
5
 *
6
 * (c) 2019 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\AdminBSBBundle\Button;
13
14
use WBW\Bundle\BootstrapBundle\Button\ButtonInterface;
15
use WBW\Bundle\BootstrapBundle\Button\ButtonRenderer as BaseRenderer;
16
17
/**
18
 * Button renderer.
19
 *
20
 * @author webeweb <https://github.com/webeweb/>
21
 * @package WBW\Bundle\AdminBSBBundle\Button
22
 */
23
class ButtonRenderer extends BaseRenderer {
24
25
    /**
26
     * Render a circle.
27
     *
28
     * @param ButtonInterface $button The button.
29
     * @param bool $circle Circle ?
30
     * @return string Returns the rendered circle.
31
     */
32
    public static function renderCircle(ButtonInterface $button, $circle) {
33
34
        if (true !== $circle) {
35
            return static::renderSize($button);
36
        }
37
38
        $output = ["btn-circle"];
39
        if (ButtonInterface::BUTTON_SIZE_LG === $button->getSize()) {
40
            $output[] = "-";
41
            $output[] = ButtonInterface::BUTTON_SIZE_LG;
42
        }
43
        $output[] = " waves-circle waves-float";
44
45
        return implode("", $output);
46
    }
47
}
48