-
-
Notifications
You must be signed in to change notification settings - Fork 492
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
PrefixAllGlobalsSniff - Passing null to parameter #1 ($string) of type string is deprecated #2203
Comments
I reckon this will be fixed in version 3.0.0 since you're running it on PHP 8.2, and v3 will be PHP 8.2 compatible. |
@dingo-d Awesome, thanks for the quick update! |
No problem, also there were issues opened with a similar error so you can check them out for more context/information. |
@dingo-d is there an eta for release of version 3? thank you |
@web-programmer-here We hope by the end of March, but we are not making any promises. There's a lot of work to do still... |
This happens as well on PHP 7 now
Previously I had solved that with PHP downgrade... but this time it is not PHP version. What else can trigger this? |
@smileBeda That issues doesn't exist on PHP 7. The notice was introduced in PHP 8.1. Are you sure you didn't accidentally update PHP or switch the PHP version being used by PHPCS ? |
maybe. Thanks! |
No idea as that depends on your system set-up, your OS etc... Can't advise without more info. |
MacOs, WPCS installed globally... I will google ;) Thanks! |
@smileBeda are you using PHP Monitor or some other tool to manage multiple PHP versions? I had issues (although on my Windows PC where I used phpenv for PHP version management) where one project was on PHP 7, but the globally applied PHP was 8. I'd recommend installing WPCS per project, using Composer. Less chance of issues like the above happening. |
Sorry the delay here.
Yet that *****
Removed brew php, WPCS did not work at all anymore. Bottom line, one more day of headbanging because we are stuck in 2020 and the world evolved (and I learned nothing from the 5 times I did this freaking process already) 🤷 |
@smileBeda Could you elaborate on what you mean by the following ?
|
I don’t recall the specific issue now, but I recall trying it last year and right away running into the next issue which was in some ticket here suggested to be resolved by not using develop 😅 anyway, I’ve set it up from scratch using php 7 again. but it gets a bit “ridiculous” really. We are long past the “grace period” to use or not use php 8. I’m aware it’s not your or anyone’s in specific fault. It’s just that the end user is basically forced into using an outdated version of php. for example, why isn’t automattic putting some resources into this process so it can be expedited? Sorry if that’s already the Case and I don’t know. Then, it’s not enough. 😀 |
You'll need to ask Automattic that, not Juliette, as she is not their employee. Putting pressure on open-source contributors and blaming them (your wording suggests that WPCS 3.0 not being released is blocking people from using PHP 8) certainly won't make releases happen sooner. |
@smileBeda Well, the short of it is that there are only so many hours in a day and very few people who seem have the expertise (or are willing to build up the expertise) to maintain tools like this. Complaining about it is not going to help, it just takes time away from maintainers doing more important stuff than responding to comments like this. Oh and I'd suggest giving |
Bug Description
After downloading a fresh copy of WPCS I get the following error:
An error occurred during processing; checking has been aborted. The error message was: trim(): Passing null to parameter #2087 /Users/{username}/Developer/wpcs/WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php on line 280
Minimal Code Snippet
The issue happens when running this command:
... over a file containing this code:
Custom ruleset
I'm using the WordPress-Extra standard.
Environment
The text was updated successfully, but these errors were encountered: