Passed
Push — master ( 5cd32c...1a1aa9 )
by Rafael
05:46
created

Base64IDEncoder::decode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 1
crap 2
1
<?php
2
/*******************************************************************************
3
 *  This file is part of the GraphQL Bundle package.
4
 *
5
 *  (c) YnloUltratech <[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 Ynlo\GraphQLBundle\Encoder;
12
13
use Ynlo\GraphQLBundle\Model\NodeInterface;
14
15
class Base64IDEncoder extends SimpleIDEncoder
16
{
17
    /**
18
     * {@inheritDoc}
19
     */
20
    public function encode(NodeInterface $node): ?string
21
    {
22
        return base64_encode(parent::encode($node));
23
    }
24
25
    /**
26
     * {@inheritDoc}
27
     */
28
    public function decode($globalId): ?NodeInterface
29
    {
30
        return parent::decode(base64_encode($globalId));
31
    }
32
}
33