Completed
Pull Request — master (#433)
by Albin
10:58
created

SafeLocal::computeKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Gaufrette\Adapter\Local;
4
5
/**
6
 * Safe local adapter that encodes key to avoid the use of the directories
7
 * structure.
8
 *
9
 * @author  Antoine Hérault <[email protected]>
10
 */
11
class SafeLocal extends Local
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16
    public function computeKey($path)
17
    {
18
        return base64_decode(parent::computeKey($path));
19
    }
20
21
    /**
22
     * {@inheritdoc}
23
     */
24
    protected function computePath($key)
25
    {
26
        return parent::computePath(base64_encode($key));
27
    }
28
}
29