Completed
Push — master ( 10f697...c17cc0 )
by WEBEWEB
02:43
created

AbstractIconTwigExtension::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * This file is part of the adminbsb-material-design-bundle package.
5
 *
6
 * (c) 2018 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\Twig\Extension\UI;
13
14
use WBW\Bundle\AdminBSBBundle\Twig\Extension\AbstractAdminBSBTwigExtension;
15
16
/**
17
 * AbstractIconTwigExtension.
18
 *
19
 * @author webeweb <https://github.com/webeweb/>
20
 * @package WBW\Bundle\AdminBSBBundle\Twig\Extension\UI
21
 * @abstract
22
 */
23
abstract class AbstractIconTwigExtension extends AbstractAdminBSBTwigExtension {
24
25
    /**
26
     * Constructor.
27
     */
28
    protected function __construct() {
29
        parent::__construct();
30
    }
31
32
    /**
33
     * Displays an AdminBSB icon.
34
     *
35
     * @param string $name The icon name.
36
     * @param string $style The icon style.
37
     * @param string $class The icon class.
38
     * @return string Returns the AdminBSB icon.
39
     */
40
    protected function adminBSBIcon($name, $style, $class = null) {
41
42
        // Initialize the attributes.
43
        $attributes = [];
44
45
        $attributes["class"] = ["material-icons", $class];
46
        $attributes["style"] = $style;
47
48
        // Initialize the parameters.
49
        $innerHTML = null !== $name ? $name : "home";
50
51
        // Return the HTML.
52
        return self::bootstrapHTMLElement("i", $innerHTML, $attributes);
0 ignored issues
show
Bug introduced by
The method bootstrapHTMLElement() does not seem to exist on object<WBW\Bundle\AdminB...tractIconTwigExtension>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
53
    }
54
55
}
56