Completed
Push — master ( 8fb7ac...bac3a6 )
by WEBEWEB
02:13
created

QuoteTwigExtension::getFunctions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
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 core-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\CoreBundle\Twig\Extension;
13
14
use Twig\TwigFunction;
15
16
/**
17
 * Quote Twig extension.
18
 *
19
 * @author webeweb <https://github.com/webeweb/>
20
 * @package WBW\Bundle\CoreBundle\Twig\Extension
21
 */
22
class QuoteTwigExtension extends AbstractTwigExtension {
23
24
    /**
25
     * Service name.
26
     *
27
     * @var string
28
     */
29
    const SERVICE_NAME = "webeweb.core.twig.extension.quote";
30
31
    /**
32
     * Get the Twig functions.
33
     *
34
     * @return TwigFunction[] Returns the Twig functions.
35
     */
36
    public function getFunctions() {
37
        return [
38
            new TwigFunction("quoteAuthor", [$this, "quoteAuthorFunction"], ["is_safe" => ["html"]]),
39
            new TwigFunction("quoteContent", [$this, "quoteContentFunction"], ["is_safe" => ["html"]]),
40
        ];
41
    }
42
43
    /**
44
     * Displays a quote author.
45
     *
46
     * @param array $args The arguments.
47
     * @return string Returns the quote author.
48
     */
49
    public function quoteAuthorFunction(array $args = []) {
0 ignored issues
show
Unused Code introduced by
The parameter $args is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
50
51
    }
52
53
    /**
54
     * Displays a quote content.
55
     *
56
     * @param array $args The arguments.
57
     * @return string Returns the quote content.
58
     */
59
    public function quoteContentFunction(array $args = []) {
0 ignored issues
show
Unused Code introduced by
The parameter $args is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
60
61
    }
62
}
63