@@ -88,7 +88,7 @@ private function isForbiddenException(string $exceptionClass): bool
88
88
$ exceptionClass = ltrim ($ exceptionClass , '\\' );
89
89
90
90
// Check if it's a native PHP exception
91
- return in_array ($ exceptionClass , self ::FORBIDDEN_EXCEPTIONS , true );
91
+ return \ in_array ($ exceptionClass , self ::FORBIDDEN_EXCEPTIONS , true );
92
92
}
93
93
94
94
private function createError (Node $ node , string $ exceptionClass , Scope $ scope , string $ context ): RuleError
@@ -101,7 +101,7 @@ private function createError(Node $node, string $exceptionClass, Scope $scope, s
101
101
102
102
$ suggestedNamespace = $ this ->getSuggestedExceptionNamespace ($ currentNamespace );
103
103
104
- $ message = sprintf (
104
+ $ message = \ sprintf (
105
105
'Use of native PHP exception "%s" is forbidden in %s context. Use "%s%s" instead. ' ,
106
106
$ exceptionClass ,
107
107
$ context ,
@@ -112,7 +112,7 @@ private function createError(Node $node, string $exceptionClass, Scope $scope, s
112
112
return RuleErrorBuilder::message ($ message )
113
113
->line ($ node ->getLine ())
114
114
->identifier ('symfonyAi.forbidNativeException ' )
115
- ->tip (sprintf (
115
+ ->tip (\ sprintf (
116
116
'Replace "%s" with "%s%s" to use a package-specific exception. ' ,
117
117
$ exceptionClass ,
118
118
$ suggestedNamespace ,
@@ -129,6 +129,6 @@ private function getSuggestedExceptionNamespace(string $currentNamespace): strin
129
129
}
130
130
}
131
131
132
- throw new \RuntimeException (sprintf ('Unexpected namespace "%s". ' , $ currentNamespace ));
132
+ throw new \RuntimeException (\ sprintf ('Unexpected namespace "%s". ' , $ currentNamespace ));
133
133
}
134
134
}
0 commit comments