SampleTokenGenerator   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A generateToken() 0 3 1
1
<?php
2
3
namespace Translation\Tokens;
4
5
/**
6
 * A nice interface for providing tokens.
7
 */
8
class SampleTokenGenerator implements TokenProviderInterface
9
{
10
    /**
11
     * Generate a fake token just as an example.
12
     *
13
     * @param  string $source Source language
14
     * @param  string $target Target langiage
15
     * @param  string $text   Text to translate
16
     * @return string Token
17
     */
18
    public function generateToken(string $source, string $target, string $text) : string
19
    {
20
        return sprintf('%d.%d', rand(10000, 99999), rand(10000, 99999));
21
    }
22
}
23