Base64IntegerDriver   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A decode() 0 5 2
1
<?php
2
3
namespace ElfSundae\Laravel\Hashid;
4
5
class Base64IntegerDriver extends Base64Driver
6
{
7
    /**
8
     * Decode the data.
9
     *
10
     * @param  mixed  $data
11
     * @return int
12
     */
13 4
    public function decode($data)
14
    {
15 4
        $int = (int) ($decoded = parent::decode($data));
16
17 4
        return (string) $int === $decoded ? $int : 0;
18
    }
19
}
20