Base64Encoder   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 3
c 1
b 0
f 1
dl 0
loc 20
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A decode() 0 3 1
A encode() 0 3 1
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