forked from PHPCompatibility/PHPCompatibility
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSniff.php
More file actions
55 lines (51 loc) · 1.29 KB
/
Sniff.php
File metadata and controls
55 lines (51 loc) · 1.29 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* PHPCompatibility_Sniff.
*
* PHP version 5.6
*
* @category PHP
* @package PHPCompatibility
* @author Wim Godden <wim.godden@cu.be>
* @copyright 2014 Cu.be Solutions bvba
*/
/**
* PHPCompatibility_Sniff.
*
* @category PHP
* @package PHPCompatibility
* @author Wim Godden <wim.godden@cu.be>
* @version 1.1.0
* @copyright 2014 Cu.be Solutions bvba
*/
abstract class PHPCompatibility_Sniff implements PHP_CodeSniffer_Sniff
{
public function supportsAbove($phpVersion)
{
if (
is_null(PHP_CodeSniffer::getConfigData('testVersion'))
||
(
!is_null(PHP_CodeSniffer::getConfigData('testVersion'))
&&
version_compare(PHP_CodeSniffer::getConfigData('testVersion'), $phpVersion) >= 0
)
) {
return true;
} else {
return false;
}
}//end supportsAbove()
public function supportsBelow($phpVersion)
{
if (
!is_null(PHP_CodeSniffer::getConfigData('testVersion'))
&&
version_compare(PHP_CodeSniffer::getConfigData('testVersion'), $phpVersion) <= 0
) {
return true;
} else {
return false;
}
}//end supportsBelow()
}//end class