diff --git a/stubs/CoreGenericFunctions.phpstub b/stubs/CoreGenericFunctions.phpstub
index 4ce4136f0..a8399e9e5 100644
--- a/stubs/CoreGenericFunctions.phpstub
+++ b/stubs/CoreGenericFunctions.phpstub
@@ -1117,6 +1117,9 @@ function preg_quote(string $str, ?string $delimiter = null) : string {}
* @psalm-pure
*
* @param string|int|float $values
+ * @return ($format is non-empty-string
+ * ? ($values is non-empty-string|int|float ? non-empty-string : string)
+ * : string)
*
* @psalm-flow ($format, $values) -> return
*/
diff --git a/tests/Config/ConfigTest.php b/tests/Config/ConfigTest.php
index 65d3a3845..0c1645e58 100644
--- a/tests/Config/ConfigTest.php
+++ b/tests/Config/ConfigTest.php
@@ -1461,7 +1461,6 @@ class ConfigTest extends TestCase
FileTypeSelfRegisteringPlugin::$names = $names;
FileTypeSelfRegisteringPlugin::$flags = $flags;
- /** @var non-empty-string $xml */
$xml = sprintf(
'
',
diff --git a/tests/Config/PluginTest.php b/tests/Config/PluginTest.php
index 62319390e..7bb95644a 100644
--- a/tests/Config/PluginTest.php
+++ b/tests/Config/PluginTest.php
@@ -801,7 +801,6 @@ class PluginTest extends TestCase
public function testPluginFilenameCanBeAbsolute(): void
{
- /** @var non-empty-string $xml */
$xml = sprintf(
'
expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('does-not-exist/plugins/StringChecker.php');
- /** @var non-empty-string $xml */
$xml = sprintf(
'
['RedundantCondition'],
'php_version' => '8.0',
];
+ yield 'sprintf yields a non-empty-string for non-empty-string value' => [
+ 'code' => ' [
+ 'code' => ' [
+ '$a===' => 'string',
+ ],
+ ];
}
}