Skip to content

Commit

Permalink
Use strlen to validate non-empty string for StringStartsWith
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterOdin authored and sebastianbergmann committed Jul 5, 2019
1 parent 08d5f6c commit 5a98bd4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Framework/Constraint/StringStartsWith.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct(string $prefix)
{
parent::__construct();

if (empty($prefix)) {
if (strlen($prefix) === 0) {
throw InvalidArgumentHelper::factory(1, 'non-empty string');
}

Expand Down

0 comments on commit 5a98bd4

Please sign in to comment.