Passed
Push — master ( 4a36e4...d17d8f )
by Asmir
08:07 queued 05:11
created

SerializerRuntimeExtension::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 1
cts 1
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace JMS\Serializer\Twig;
6
7
use Twig\TwigFilter;
8
use Twig\TwigFunction;
9
10
/**
11
 * @author Asmir Mustafic <[email protected]>
12
 */
13 1
final class SerializerRuntimeExtension extends SerializerBaseExtension
14
{
15 1
    /**
16
     * @return TwigFilter[]
17
     *
18 1
     * @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint
19
     */
20
    public function getFilters()
21 1
    {
22
        return [
23
            new TwigFilter($this->serializationFunctionsPrefix . 'serialize', [SerializerRuntimeHelper::class, 'serialize']),
24
        ];
25 1
    }
26
27
    /**
28 1
     * @return TwigFunction[]
29
     *
30
     * @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint
31
     */
32
    public function getFunctions()
33
    {
34
        return [
35
            new TwigFunction($this->serializationFunctionsPrefix . 'serialization_context', '\JMS\Serializer\SerializationContext::create'),
36
        ];
37
    }
38
}
39