BootstrapWidgets::get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Mezon\Gui\WidgetsRegistry;
3
4
/**
5
 * Class BootstrapWidgets
6
 *
7
 * @package WidgetsRegistry
8
 * @subpackage BootstrapWidgets
9
 * @author Dodonov A.A.
10
 * @version v.1.0 (2019/09/02)
11
 * @copyright Copyright (c) 2019, http://aeon.su
12
 */
13
14
/**
15
 * Bootstrap widgets
16
 */
17
class BootstrapWidgets implements WidgetsRegistryBase
18
{
19
20
    /**
21
     * Method returns widget
22
     *
23
     * @param string $name
24
     *            name of the widget
25
     * @return string widget's HTML code
26
     */
27
    public function getWidget(string $name): string
28
    {
29
        return BootstrapWidgets::get($name);
30
    }
31
32
    /**
33
     * Method returns widget
34
     *
35
     * @param string $name
36
     *            name of the widget
37
     * @return string widget's HTML code
38
     */
39
    public static function get(string $name): string
40
    {
41
        return file_get_contents(__DIR__ . '/res/templates/' . $name . '.tpl');
42
    }
43
}
44