You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/PHPStan/Rules/Comparison/StrictComparisonOfDifferentTypesRuleTest.php
+20-9Lines changed: 20 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -277,7 +277,8 @@ public function testStrictComparison(): void
277
277
[
278
278
'Strict comparison using === between lowercase-string|false and \'AB\' will always evaluate to false.',
279
279
1014,
280
-
$tipText,
280
+
"• 'AB' is not lowercase.
281
+
• Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.",
281
282
],
282
283
[
283
284
'Strict comparison using === between mixed and null will always evaluate to false.',
@@ -1098,41 +1099,48 @@ public function testLowercaseString(): void
1098
1099
[
1099
1100
"Strict comparison using === between lowercase-string and 'AB' will always evaluate to false.",
1100
1101
10,
1101
-
'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.',
1102
+
"• 'AB' is not lowercase.
1103
+
• Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.",
1102
1104
],
1103
1105
[
1104
1106
"Strict comparison using === between 'AB' and lowercase-string will always evaluate to false.",
1105
1107
11,
1106
-
'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.',
1108
+
"• 'AB' is not lowercase.
1109
+
• Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.",
1107
1110
],
1108
1111
[
1109
1112
"Strict comparison using !== between 'AB' and lowercase-string will always evaluate to true.",
1110
1113
12,
1111
-
'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.',
1114
+
"• 'AB' is not lowercase.
1115
+
• Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.",
1112
1116
],
1113
1117
[
1114
1118
"Strict comparison using === between lowercase-string and 'aBc' will always evaluate to false.",
1115
1119
15,
1116
-
'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.',
1120
+
"• 'aBc' is not lowercase.
1121
+
• Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.",
1117
1122
],
1118
1123
[
1119
1124
"Strict comparison using !== between lowercase-string and 'aBc' will always evaluate to true.",
1120
1125
16,
1121
-
'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.',
1126
+
"• 'aBc' is not lowercase.
1127
+
• Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.",
1122
1128
],
1123
1129
];
1124
1130
1125
1131
if (PHP_VERSION_ID < 80000) {
1126
1132
$errors[] = [
1127
1133
"Strict comparison using === between lowercase-string|false and 'AB' will always evaluate to false.",
1128
1134
28,
1129
-
'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.',
1135
+
"• 'AB' is not lowercase.
1136
+
• Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.",
1130
1137
];
1131
1138
} else {
1132
1139
$errors[] = [
1133
1140
"Strict comparison using === between lowercase-string and 'AB' will always evaluate to false.",
1134
1141
28,
1135
-
'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.',
1142
+
"• 'AB' is not lowercase.
1143
+
• Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.",
1136
1144
];
1137
1145
}
1138
1146
@@ -1153,15 +1161,18 @@ public function testHashing(): void
1153
1161
[
1154
1162
"Strict comparison using === between lowercase-string&non-falsy-string and 'ABC' will always evaluate to false.",
1155
1163
9,
1164
+
"'ABC' is not lowercase.",
1156
1165
],
1157
1166
[
1158
1167
"Strict comparison using === between (lowercase-string&non-falsy-string)|false and 'ABC' will always evaluate to false.",
1159
1168
12,
1169
+
"'ABC' is not lowercase.",
1160
1170
],
1161
1171
[
1162
1172
"Strict comparison using === between (lowercase-string&non-falsy-string)|(non-falsy-string&numeric-string) and 'A' will always evaluate to false.",
1163
1173
31,
1164
-
'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.',
1174
+
"• 'A' is not lowercase.
1175
+
• Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.",
0 commit comments