Completed
Pull Request — master (#437)
by Quetzy
10:38
created

Base64Encoder   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 16
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
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 Laravel Auditing package.
4
 *
5
 * @author     Antério Vieira <[email protected]>
6
 * @author     Quetzy Garcia  <[email protected]>
7
 * @author     Raphael França <[email protected]>
8
 * @copyright  2015-2018
9
 *
10
 * For the full copyright and license information,
11
 * please view the LICENSE.md file that was distributed
12
 * with this source code.
13
 */
14
15
namespace OwenIt\Auditing\Encoders;
16
17
class Base64Encoder implements \OwenIt\Auditing\Contracts\AttributeEncoder
18
{
19
    /**
20
     * {@inheritdoc}
21
     */
22 3
    public static function encode($value): string
23
    {
24 3
        return base64_encode($value);
25
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30 3
    public static function decode($value): string
31
    {
32 3
        return base64_decode($value);
33
    }
34
}
35