Completed
Push — master ( 938e53...9bacf6 )
by WEBEWEB
02:27
created

adminBSBUnderline()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 16
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 6
nc 2
nop 1
1
<?php
2
3
/*
4
 * Disclaimer: This source code is protected by copyright law and by
5
 * international conventions.
6
 *
7
 * Any reproduction or partial or total distribution of the source code, by any
8
 * means whatsoever, is strictly forbidden.
9
 *
10
 * Anyone not complying with these provisions will be guilty of the offense of
11
 * infringement and the penal sanctions provided for by law.
12
 *
13
 * © 2018 All rights reserved.
14
 */
15
16
namespace WBW\Bundle\AdminBSBBundle\Twig\Extension\Typography;
17
18
use WBW\Bundle\AdminBSBBundle\Twig\Extension\AbstractAdminBSBTwigExtension;
19
use WBW\Library\Core\Utility\Argument\StringUtility;
20
21
/**
22
 * Abstract typography Twig extension.
23
 *
24
 * @author webeweb <https://github.com/webeweb/>
25
 * @package WBW\Bundle\AdminBSBBundle\Twig\Extension\Typography
26
 * @abstract
27
 */
28
abstract class AbstractTypographyTwigExtension extends AbstractAdminBSBTwigExtension {
29
30
    /**
31
     * Constructor.
32
     */
33
    protected function __construct() {
34
        parent::__construct();
35
    }
36
37
    /**
38
     * Displays an AdminBSB bold text.
39
     *
40
     * @param string $content The content.
41
     * @return string Returns the AdminBSB bold text.
42
     */
43
    protected function adminBSBBold($content) {
44
45
        // Initialize the template.
46
        $template = "<span %attributes%>%innerHTML%</span>";
47
48
        // Initialize the attributes
49
        $attributes = [];
50
51
        $attributes["class"] = "font-bold";
52
53
        // Initialize the parameters.
54
        $innerHTML = null !== $content ? $content : "";
55
56
        // Return the HTML.
57
        return StringUtility::replace($template, ["%attributes%", "%innerHTML%"], [StringUtility::parseArray($attributes), $innerHTML]);
58
    }
59
60
    /**
61
     * Displays an AdminBSB italic text.
62
     *
63
     * @param string $content The content.
64
     * @return string Returns the AdminBSB italic text.
65
     */
66
    protected function adminBSBItalic($content) {
67
68
        // Initialize the template.
69
        $template = "<span %attributes%>%innerHTML%</span>";
70
71
        // Initialize the attributes
72
        $attributes = [];
73
74
        $attributes["class"] = "font-italic";
75
76
        // Initialize the parameters.
77
        $innerHTML = null !== $content ? $content : "";
78
79
        // Return the HTML.
80
        return StringUtility::replace($template, ["%attributes%", "%innerHTML%"], [StringUtility::parseArray($attributes), $innerHTML]);
81
    }
82
83
    /**
84
     * Displays an AdminBSB line through text.
85
     *
86
     * @param string $content The content.
87
     * @return string Returns the AdminBSB line through text.
88
     */
89
    protected function adminBSBLineThrough($content) {
90
91
        // Initialize the template.
92
        $template = "<span %attributes%>%innerHTML%</span>";
93
94
        // Initialize the attributes
95
        $attributes = [];
96
97
        $attributes["class"] = "font-line-through";
98
99
        // Initialize the parameters.
100
        $innerHTML = null !== $content ? $content : "";
101
102
        // Return the HTML.
103
        return StringUtility::replace($template, ["%attributes%", "%innerHTML%"], [StringUtility::parseArray($attributes), $innerHTML]);
104
    }
105
106
    /**
107
     * Displays an AdminBSB overlined text.
108
     *
109
     * @param string $content The content.
110
     * @return string Returns the AdminBSB overlined text.
111
     */
112
    protected function adminBSBOverline($content) {
113
114
        // Initialize the template.
115
        $template = "<span %attributes%>%innerHTML%</span>";
116
117
        // Initialize the attributes
118
        $attributes = [];
119
120
        $attributes["class"] = "font-overline";
121
122
        // Initialize the parameters.
123
        $innerHTML = null !== $content ? $content : "";
124
125
        // Return the HTML.
126
        return StringUtility::replace($template, ["%attributes%", "%innerHTML%"], [StringUtility::parseArray($attributes), $innerHTML]);
127
    }
128
129
    /**
130
     * Displays an AdminBSB underlined text.
131
     *
132
     * @param string $content The content.
133
     * @return string Returns the AdminBSB underlined text.
134
     */
135
    protected function adminBSBUnderline($content) {
136
137
        // Initialize the template.
138
        $template = "<span %attributes%>%innerHTML%</span>";
139
140
        // Initialize the attributes
141
        $attributes = [];
142
143
        $attributes["class"] = "font-underline";
144
145
        // Initialize the parameters.
146
        $innerHTML = null !== $content ? $content : "";
147
148
        // Return the HTML.
149
        return StringUtility::replace($template, ["%attributes%", "%innerHTML%"], [StringUtility::parseArray($attributes), $innerHTML]);
150
    }
151
152
}
153