Completed
Push — master ( 281270...5bd029 )
by Fabian
01:52
created

Nonce::generate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 6
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 6
loc 6
ccs 0
cts 4
cp 0
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * @author fabian.hanisch
4
 * @since  2017-07-17
5
 */
6
7
namespace HanischIt\KrakenApi\Service\RequestService;
8
9
/**
10
 * Class Nonce
11
 *
12
 * @package HanischIt\KrakenApi\Service\RequestService
13
 */
14
class Nonce
15
{
16 View Code Duplication
    public function generate()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
    {
18
        $nonce = explode(' ', microtime());
19
        $nonce = $nonce[1] . str_pad(substr($nonce[0], 2, 6), 6, '0');
20
21
        return $nonce;
22
    }
23
}
24