Passed
Push — master ( 923b5a...eadb90 )
by Valentin
44s queued 12s
created

version.php ➔ phpVersionBetween()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Spiral Framework. Cycle ProxyFactory
5
 *
6
 * @license MIT
7
 * @author  Valentin V (Vvval)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Cycle\ORM\Promise;
13
14
/**
15
 * @param string $v1
16
 * @param string $v2
17
 * @return bool
18
 */
19
function phpVersionBetween(string $v1, string $v2): bool
20
{
21
    return version_compare(phpVersion(), $v1, '>=') && version_compare(phpVersion(), $v2, '<');
22
}
23
24
/**
25
 * @return string
26
 */
27
function phpVersion(): string
28
{
29
    return PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION . '.' . PHP_RELEASE_VERSION;
30
}
31