Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tests/acceptance/SprintfNonEmptyString.feature
Original file line number Diff line number Diff line change
Expand Up @@ -307,3 +307,16 @@ Feature: non empty template passed to sprintf results in non-empty-string
"""
When I run psalm
Then I see no errors

Scenario: Template is non-empty-string based on union types which are all literal strings with a length > 0
Given I have the following code
"""
$foo = 'bar %s';
if (random_int(0,1) === 1) {
$foo = 'baz %s';
}

nonEmptyString(sprintf($foo, ''));
"""
When I run psalm
Then I see no errors