TypographyTwigExtension::getFunctions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 9.6333
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\Typography;
13
14
use Twig\TwigFilter;
15
use Twig\TwigFunction;
16
use WBW\Library\Core\Argument\Helper\ArrayHelper;
17
18
/**
19
 * Typography Twig extension.
20
 *
21
 * @author webeweb <https://github.com/webeweb/>
22
 * @package WBW\Bundle\AdminBSBBundle\Twig\Extension\Typography
23
 */
24
class TypographyTwigExtension extends AbstractTypographyTwigExtension {
25
26
    /**
27
     * Service name.
28
     *
29
     * @var string
30
     */
31
    const SERVICE_NAME = "wbw.adminbsb.twig.extension.typography";
32
33
    /**
34
     * Displays an AdminBSB bold text.
35
     *
36
     * @param array $args The arguments.
37
     * @return string Returns the AdminBSB bold text.
38
     */
39
    public function adminBSBBoldFunction(array $args = []): string {
40
        return $this->adminBSBBold(ArrayHelper::get($args, "content"));
41
    }
42
43
    /**
44
     * Displays an AdminBSB italic text.
45
     *
46
     * @param array $args The arguments.
47
     * @return string Returns the AdminBSB italic text.
48
     */
49
    public function adminBSBItalicFunction(array $args = []): string {
50
        return $this->adminBSBItalic(ArrayHelper::get($args, "content"));
51
    }
52
53
    /**
54
     * Displays an AdminBSB line through text.
55
     *
56
     * @param array $args The arguments.
57
     * @return string Returns the AdminBSB line through text.
58
     */
59
    public function adminBSBLineThroughFunction(array $args = []): string {
60
        return $this->adminBSBLineThrough(ArrayHelper::get($args, "content"));
61
    }
62
63
    /**
64
     * Displays an AdminBSB overlined text.
65
     *
66
     * @param array $args The arguments.
67
     * @return string Returns the AdminBSB overlined text.
68
     */
69
    public function adminBSBOverlineFunction(array $args = []): string {
70
        return $this->adminBSBOverline(ArrayHelper::get($args, "content"));
71
    }
72
73
    /**
74
     * Displays an AdminBSB underline text.
75
     *
76
     * @param array $args The arguments.
77
     * @return string Returns the AdminBSB underline text.
78
     */
79
    public function adminBSBUnderlineFunction(array $args = []): string {
80
        return $this->adminBSBUnderline(ArrayHelper::get($args, "content"));
81
    }
82
83
    /**
84
     * Get the Twig filters.
85
     *
86
     * @return TwigFilter[] Returns the Twig filters.
87
     */
88
    public function getFilters(): array {
89
        return [];
90
    }
91
92
    /**
93
     * Get the Twig functions.
94
     *
95
     * @return TwigFunction[] Returns the Twig functions.
96
     */
97
    public function getFunctions(): array {
98
        return [
99
            new TwigFunction("adminBSBBold", [$this, "adminBSBBoldFunction"], ["is_safe" => ["html"]]),
100
            new TwigFunction("adminBSBDeleted", [$this, "bootstrapDeletedFunction"], ["is_safe" => ["html"]]),
101
            new TwigFunction("adminBSBHeading1", [$this, "bootstrapHeading1Function"], ["is_safe" => ["html"]]),
102
            new TwigFunction("adminBSBHeading2", [$this, "bootstrapHeading2Function"], ["is_safe" => ["html"]]),
103
            new TwigFunction("adminBSBHeading3", [$this, "bootstrapHeading3Function"], ["is_safe" => ["html"]]),
104
            new TwigFunction("adminBSBHeading4", [$this, "bootstrapHeading4Function"], ["is_safe" => ["html"]]),
105
            new TwigFunction("adminBSBHeading5", [$this, "bootstrapHeading5Function"], ["is_safe" => ["html"]]),
106
            new TwigFunction("adminBSBHeading6", [$this, "bootstrapHeading6Function"], ["is_safe" => ["html"]]),
107
            new TwigFunction("adminBSBInserted", [$this, "bootstrapInsertedFunction"], ["is_safe" => ["html"]]),
108
            new TwigFunction("adminBSBItalic", [$this, "adminBSBItalicFunction"], ["is_safe" => ["html"]]),
109
            new TwigFunction("adminBSBLineThrough", [$this, "adminBSBLineThroughFunction"], ["is_safe" => ["html"]]),
110
            new TwigFunction("adminBSBMarked", [$this, "bootstrapMarkedFunction"], ["is_safe" => ["html"]]),
111
            new TwigFunction("adminBSBOverline", [$this, "adminBSBOverlineFunction"], ["is_safe" => ["html"]]),
112
            new TwigFunction("adminBSBSmall", [$this, "bootstrapSmallFunction"], ["is_safe" => ["html"]]),
113
            new TwigFunction("adminBSBUnderline", [$this, "adminBSBUnderlineFunction"], ["is_safe" => ["html"]]),
114
        ];
115
    }
116
}
117