Base62IntegerDriver   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 3
c 2
b 0
f 0
dl 0
loc 22
ccs 4
cts 4
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A decode() 0 3 1
A encode() 0 3 1
1
<?php
2
3
namespace ElfSundae\Laravel\Hashid;
4
5
class Base62IntegerDriver extends Base62Driver
6
{
7
    /**
8
     * Encode the data.
9
     *
10
     * @param  int  $data
11
     * @return string
12
     */
13 8
    public function encode($data)
14
    {
15 8
        return $this->base62->encodeInteger($data);
16
    }
17
18
    /**
19
     * Decode the data.
20
     *
21
     * @param  string  $data
22
     * @return int
23
     */
24 8
    public function decode($data)
25
    {
26 8
        return $this->base62->decodeInteger($data);
27
    }
28
}
29