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

ButtonRenderer::renderCircle()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.7666
c 0
b 0
f 0
cc 3
nc 3
nop 2
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