Passed
Pull Request — master (#13)
by Shinji
02:00
created

TraceLoopSettings::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 3
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * This file is part of the sj-i/php-profiler package.
5
 *
6
 * (c) sji <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace PhpProfiler\Inspector\Settings\TraceLoopSettings;
15
16
final class TraceLoopSettings
17
{
18
    public const SLEEP_NANO_SECONDS_DEFAULT = 1000 * 1000 * 10;
19
    public const CANCEL_KEY_DEFAULT = 'q';
20
    public const MAX_RETRY_DEFAULT = 10;
21
22
    public int $sleep_nano_seconds;
23
    public string $cancel_key;
24
    public int $max_retries;
25
26
    /**
27
     * TraceLoopSettings constructor.
28
     * @param int $sleep_nano_seconds
29
     * @param string $cancel_key
30
     * @param int $max_retries
31
     */
32
    public function __construct(int $sleep_nano_seconds, string $cancel_key, int $max_retries)
33
    {
34
        $this->sleep_nano_seconds = $sleep_nano_seconds;
35
        $this->cancel_key = $cancel_key;
36
        $this->max_retries = $max_retries;
37
    }
38
}
39