~fkooman/vpn-user-portal

ref: 57df62b9a04e9b2391ca809e5ff9d76e524eceb1 vpn-user-portal/tests/TestOAuthServerRandom.php -rw-r--r-- 537 bytes
57df62b9François Kooman update CHANGES 1 year, 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php

/*
 * eduVPN - End-user friendly VPN.
 *
 * Copyright: 2016-2019, The Commons Conservancy eduVPN Programme
 * SPDX-License-Identifier: AGPL-3.0+
 */

namespace LC\Portal\Tests;

use fkooman\OAuth\Server\RandomInterface;

class TestOAuthServerRandom implements RandomInterface
{
    /** @var int */
    private $counter = 1;

    /**
     * Get a randomly generated crypto secure string.
     *
     * @param int $length
     */
    public function get($length)
    {
        return sprintf('random_%d', $this->counter++);
    }
}