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
{{ message }}
Repository navigation
Commit a0e754d
Browse filesBrowse the repository at this point in the historyBrowse files
RuleErrorBuilder::message(sprintf('Using nullsafe method call on non-nullable type %s. Use -> instead.', $calledOnType->describe(VerbosityLevel::typeOnly())))
34
-
->line($node->name->getStartLine())
35
-
->identifier('nullsafe.neverNull')
36
-
->build(),
37
-
];
42
+
$addTip = function (RuleErrorBuilder$ruleErrorBuilder) use ($scope, $node): RuleErrorBuilder {
43
+
if (!$this->treatPhpDocTypesAsCertain || !$this->treatPhpDocTypesAsCertainTip) {
@@ -37,12 +43,29 @@ public function processNode(Node $node, Scope $scope): array
37
43
return [];
38
44
}
39
45
40
-
return [
41
-
RuleErrorBuilder::message(sprintf('Using nullsafe property access on non-nullable type %s. Use -> instead.', $calledOnType->describe(VerbosityLevel::typeOnly())))
42
-
->line($node->name->getStartLine())
43
-
->identifier('nullsafe.neverNull')
44
-
->build(),
45
-
];
46
+
$addTip = function (RuleErrorBuilder$ruleErrorBuilder) use ($scope, $node): RuleErrorBuilder {
47
+
if (!$this->treatPhpDocTypesAsCertain || !$this->treatPhpDocTypesAsCertainTip) {
'Using nullsafe method call on non-nullable type $this(Bug14150NullsafeMethod\HelloWorld). Use -> instead.',
45
59
21,
60
+
'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%</>.',
'Using nullsafe property access on non-nullable type $this(Bug14150NullsafeProperty\HelloWorld). Use -> instead.',
@@ -65,19 +82,33 @@ public function testBug14150(): void
65
82
[
66
83
'Using nullsafe property access on non-nullable type $this(Bug14150NullsafeProperty\HelloWorld). Use -> instead.',
67
84
27,
85
+
'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