diff --git a/src/utils.php b/src/utils.php index c8df000..04553ce 100644 --- a/src/utils.php +++ b/src/utils.php @@ -174,5 +174,5 @@ function getVendorDir(\stdClass $composerJson = null): string function strStartsWith(string $haystack, string $prefix): bool { - return empty($prefix) || strpos($haystack, $prefix) === 0; + return substr($haystack, 0, strlen($prefix)) === $prefix; }