Base64Encoder::encode()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
/*
3
 * This file is part of the Guarded Authentication package.
4
 *
5
 * (c) Jafar Jabr <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Jafar\Bundle\GuardedAuthenticationBundle\Api\JWTSigner\Base64;
12
13
/**
14
 * Class Base64Encoder.
15
 *
16
 * @author Jafar Jabr <[email protected]>
17
 */
18
class Base64Encoder implements EncoderInterface
19
{
20
    /**
21
     * @param string $data
22
     *
23
     * @return string
24
     */
25
    public function encode($data)
26
    {
27
        return base64_encode($data);
28
    }
29
30
    /**
31
     * @param string $data
32
     *
33
     * @return string
34
     */
35
    public function decode($data)
36
    {
37
        return base64_decode($data);
38
    }
39
}
40