New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Argument 2 passed to Composer\Pcre\Preg::isMatch() must be of the type string, null given #10888
Comments
Do you not have git installed on CI, or why is it failing to execute I mean we need to fix this regardless, but I am curious how you reach this code path. |
Interesting... @Seldaek, on CI after run
Trace:
I'm using version 2.4.2. Could it have something to do with this error? |
@brunoborghi that is an unrelated issue, but I wonder how that is possible at all. The $contents / arg #2 here https://github.com/composer/class-map-generator/blob/main/src/PhpFileParser.php#L55 should always be a string as php_strip_whitespace can only return a string, and as per https://3v4l.org/r4kMa it seems to be the case even for non-existent paths. It doesn't make sense to me how it'd be null. |
In the CI (not on my machine) during a
composer create-project
, this error occurs:I think this is related to composer/pcre@2e56743, #10662 and 0708eb4.
Looking at the code, I could see how this could possibly go wrong:
composer/src/Composer/Downloader/GitDownloader.php
Lines 455 to 458 in 10cd375
composer/src/Composer/Downloader/GitDownloader.php
Lines 472 to 477 in 10cd375
So, it seems like the
$branches
var is used while it is null.However, it's hard for me to check if adding a
&& $branches
to the outer if-statement is enough to fix this issue, because this error only happens in the CI for me. But it seems like a good thing to do anyway.The text was updated successfully, but these errors were encountered: