Passed
Branch update-packages (3d19b9)
by Elf
04:14
created

Base62IntegerDriver   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 3
dl 0
loc 22
rs 10
c 0
b 0
f 0

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
    public function encode($data)
14
    {
15
        return $this->base62->encodeInteger($data);
16
    }
17
18
    /**
19
     * Decode the data.
20
     *
21
     * @param  string  $data
22
     * @return int
23
     */
24
    public function decode($data)
25
    {
26
        return $this->base62->decodeInteger($data);
27
    }
28
}
29