Skip to content
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

php 8.1 compatibility #288

Open
adixon opened this issue Jan 25, 2023 · 2 comments
Open

php 8.1 compatibility #288

adixon opened this issue Jan 25, 2023 · 2 comments

Comments

@adixon
Copy link
Contributor

adixon commented Jan 25, 2023

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///usr/local/bin/civix/src/CRM/CivixBundle/Command/InitCommand.php on line 231

Says it all? Using php8.1, just downloaded civix via the tarball.

@totten
Copy link
Owner

totten commented Feb 25, 2023

@adixon That's weird. This is the context of line 231 (and it's the only trim() in the file):

    if (\CRM\CivixBundle\Utils\Commands::findExecutable('git')) {
      $result = trim(`git config --get $key`);
    }

Any idea how git config could return null? In the worst case, I would expect it to output '' or some textual noise. I'm not aware any null construct for pipes/subprocesses.

@adixon
Copy link
Contributor Author

adixon commented Feb 26, 2023

From what I remember of what I was doing then, I'd guess that git user.email or user.name had not been configured.

So it would appear that git config returns null if the key doesn't exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants