• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

keradus / PHP-CS-Fixer / 15274850899

27 May 2025 11:01AM UTC coverage: 94.849% (-0.02%) from 94.87%
15274850899

push

github

web-flow
DX: introduce `FCT` class for tokens not present in the lowest supported PHP version (#8706)

Co-authored-by: Dariusz Rumiński <dariusz.ruminski@gmail.com>

186 of 192 new or added lines in 52 files covered. (96.88%)

72 existing lines in 9 files now uncovered.

28099 of 29625 relevant lines covered (94.85%)

45.33 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Tokenizer/FCT.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This file is part of PHP CS Fixer.
7
 *
8
 * (c) Fabien Potencier <fabien@symfony.com>
9
 *     Dariusz Rumiński <dariusz.ruminski@gmail.com>
10
 *
11
 * This source file is subject to the MIT license that is bundled
12
 * with this source code in the file LICENSE.
13
 */
14

15
namespace PhpCsFixer\Tokenizer;
16

17
/*
18
 * Forward Compatibility Tokens
19
 *
20
 * Class containing tokens that are not present in the lowest supported PHP version,
21
 * so the code can always use the class constant, instead of checking if the constant is defined
22
 */
NEW
23
if (\PHP_VERSION_ID >= 8_04_00) {
×
24
    /**
25
     * @internal
26
     */
27
    final class FCT
28
    {
29
        public const T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG = T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG;
30
        public const T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG = T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG;
31
        public const T_ATTRIBUTE = T_ATTRIBUTE;
32
        public const T_ENUM = T_ENUM;
33
        public const T_MATCH = T_MATCH;
34
        public const T_NULLSAFE_OBJECT_OPERATOR = T_NULLSAFE_OBJECT_OPERATOR;
35
        public const T_PUBLIC_SET = T_PUBLIC_SET;
36
        public const T_PROTECTED_SET = T_PROTECTED_SET;
37
        public const T_PRIVATE_SET = T_PRIVATE_SET;
38
        public const T_READONLY = T_READONLY;
39
    }
NEW
40
} elseif (\PHP_VERSION_ID >= 8_01_00) {
×
41
    /**
42
     * @internal
43
     */
44
    final class FCT
45
    {
46
        public const T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG = T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG;
47
        public const T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG = T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG;
48
        public const T_ATTRIBUTE = T_ATTRIBUTE;
49
        public const T_ENUM = T_ENUM;
50
        public const T_MATCH = T_MATCH;
51
        public const T_NULLSAFE_OBJECT_OPERATOR = T_NULLSAFE_OBJECT_OPERATOR;
52
        public const T_PUBLIC_SET = -1;
53
        public const T_PROTECTED_SET = -2;
54
        public const T_PRIVATE_SET = -3;
55
        public const T_READONLY = T_READONLY;
56
    }
NEW
57
} elseif (\PHP_VERSION_ID >= 8_00_00) {
×
58
    /**
59
     * @internal
60
     */
61
    final class FCT
62
    {
63
        public const T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG = -1;
64
        public const T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG = -2;
65
        public const T_ATTRIBUTE = T_ATTRIBUTE;
66
        public const T_ENUM = -3;
67
        public const T_MATCH = T_MATCH;
68
        public const T_NULLSAFE_OBJECT_OPERATOR = T_NULLSAFE_OBJECT_OPERATOR;
69
        public const T_PUBLIC_SET = -4;
70
        public const T_PROTECTED_SET = -5;
71
        public const T_PRIVATE_SET = -6;
72
        public const T_READONLY = -7;
73
    }
74
} else {
75
    /**
76
     * @internal
77
     */
78
    final class FCT
79
    {
80
        public const T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG = -1;
81
        public const T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG = -2;
82
        public const T_ATTRIBUTE = -3;
83
        public const T_ENUM = -4;
84
        public const T_MATCH = -5;
85
        public const T_NULLSAFE_OBJECT_OPERATOR = -6;
86
        public const T_PUBLIC_SET = -7;
87
        public const T_PROTECTED_SET = -8;
88
        public const T_PRIVATE_SET = -9;
89
        public const T_READONLY = -10;
90
    }
91
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc