forked from phan/phan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PhanSuspiciousNamedArgumentVariadicInternal
Warn about code such as `sprintf('foo=%s', foo: 'value')` Fixes phan#4284
- Loading branch information
1 parent
1664d17
commit a8ee551
Showing
7 changed files
with
94 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
%s:5 PhanCompatibleNamedArgument Cannot use named arguments before php 8.0 in argument (arg: 123) | ||
%s:6 PhanCompatibleNamedArgument Cannot use named arguments before php 8.0 in argument (foo: 'test') | ||
%s:6 PhanPluginUseReturnValueInternalKnown Expected to use the return value of the internal function/method \sprintf | ||
%s:6 PhanSuspiciousNamedArgumentVariadicInternal Passing named argument foo: 'test' to the variadic parameter of the internal function \sprintf(string $format, ...$values). Except for a few internal methods that call methods/constructors dynamically, this is usually not supported by internal functions. | ||
%s:8 PhanCompatibleNamedArgument Cannot use named arguments before php 8.0 in argument (arg: 123) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
function decode_or_default(string $json) { | ||
return json_decode($json) ?? 'default'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
function test36(int $arg) { | ||
var_export($arg); | ||
} | ||
call_user_func('test36', arg: 123); | ||
sprintf("foo=%s\n", foo: 'test'); | ||
$c = Closure::fromCallable('test36'); | ||
$c->call(arg: 123); |