Skip to content

Commit ef44f76

Browse files
committed
Merge branch 'feature/tokenizer-php-bugfix' of https://github.com/jrfnl/PHP_CodeSniffer
2 parents 0735c1c + 23e4e61 commit ef44f76

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/Tokenizers/PHP.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2856,6 +2856,7 @@ protected function processAdditional()
28562856
T_NAME_QUALIFIED => T_NAME_QUALIFIED,
28572857
T_TYPE_UNION => T_TYPE_UNION,
28582858
T_BITWISE_OR => T_BITWISE_OR,
2859+
T_BITWISE_AND => T_BITWISE_AND,
28592860
T_ARRAY => T_ARRAY,
28602861
T_CALLABLE => T_CALLABLE,
28612862
T_SELF => T_SELF,

tests/Core/Tokenizer/BackfillReadonlyTest.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ class Foo
5252
public function __construct(private readonly bool $constructorPropertyPromotion)
5353
{
5454
}
55+
56+
/* testReadonlyConstructorPropertyPromotionWithReference */
57+
public function __construct(private ReadOnly bool &$constructorPropertyPromotion) {}
5558
}
5659

5760
$anonymousClass = new class () {

tests/Core/Tokenizer/BackfillReadonlyTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ public function dataReadonly()
139139
'/* testReadonlyConstructorPropertyPromotion */',
140140
'readonly',
141141
],
142+
[
143+
'/* testReadonlyConstructorPropertyPromotionWithReference */',
144+
'ReadOnly',
145+
],
142146
[
143147
'/* testReadonlyPropertyInAnonymousClass */',
144148
'readonly',

0 commit comments

Comments
 (0)