Skip to content

Commit 816605b

Browse files
Fix nullable properties validation
1 parent 8b32c99 commit 816605b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Magento2/Sniffs/Commenting/ClassPropertyPHPDocFormattingSniff.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ class ClassPropertyPHPDocFormattingSniff extends AbstractVariableSniff
2828
T_WHITESPACE,
2929
T_NS_SEPARATOR,
3030
T_STRING,
31-
T_COMMENT
31+
T_COMMENT,
32+
T_NULLABLE
3233
];
3334

3435
/**

Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,11 @@ class correctlyFormattedClassMemberDocBlock
135135
* @var string
136136
*/
137137
protected string $test1;
138+
139+
/**
140+
* Ensure that nullable sign in the property type hint declaration is interpreted correctly
141+
*
142+
* @var string|null
143+
*/
144+
protected ?string $test2;
138145
}

0 commit comments

Comments
 (0)