ComparerToken::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Duje
5
 * Date: 29-May-18
6
 * Time: 2:34 PM
7
 */
8
declare(strict_types=1);
9
10
namespace Locastic\SyliusComparerPlugin\Utils;
11
12
use Sylius\Component\Resource\Generator\RandomnessGeneratorInterface;
13
14
final class ComparerToken implements ComparerTokenInterface
15
{
16
    /** @var RandomnessGeneratorInterface */
17
    private $randomGenerator;
18
19
    public function __construct(RandomnessGeneratorInterface $randomGenerator)
20
    {
21
        $this->randomGenerator = $randomGenerator;
22
    }
23
24
    public function provide(): string
25
    {
26
        $token = $this->randomGenerator->generateUriSafeString(self::TOKEN_LENGTH);
27
28
        return $token;
29
    }
30
}
31