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 Fatal error: Uncaught PHP_CodeSniffer\Exceptions\RuntimeException: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/vendor/squizlabs/php_codesniffer/src/Files/LocalFile.php on line 32 in #2087

Closed
1 task done
saas786 opened this issue Oct 15, 2022 · 15 comments

Comments

@saas786
Copy link

saas786 commented Oct 15, 2022

Bug Description

Because of no PHP 8.1 support yet, it causes issue with phpcs / phpcbf.

See squizlabs/PHP_CodeSniffer#3677

These places it needs to be fixed:

Until full support is added #2070, maybe a small fix release fixing it would be nice?

Question Answer
PHP version 8.1.7
PHP_CodeSniffer version 3.7.1
WPCS version 2.3.0

Tested Against develop branch?

  • I have verified the issue still exists in the develop branch of WPCS.
@jrfnl
Copy link
Member

jrfnl commented Oct 15, 2022

Closing as duplicate. This has been asked and answered multiple times before.

@jrfnl jrfnl closed this as not planned Won't fix, can't repro, duplicate, stale Oct 15, 2022
@saas786
Copy link
Author

saas786 commented Oct 17, 2022

Closing as duplicate. This has been asked and answered multiple times before.

Could you please point me to relevant questions where you have provided an answer?
I could benefit from those replies as well.
Thanks.

@dingo-d
Copy link
Member

dingo-d commented Oct 17, 2022

I think it's this one: #2035

You can just search the issues for the relevant information 😉

@saas786
Copy link
Author

saas786 commented Oct 17, 2022

I think it's this one: #2035

You can just search the issues for the relevant information 😉

Thanks, but there is nothing there which resolves my issue, I can't use develop and I see no solution out there which resolves it.

I did some quick search and found no helpful solutions / answers, that's why asked you.

Anyway, I understand the reasoning, so no problem.

@GaryJones
Copy link
Member

@saas786

I can't use develop

Why not?

@saas786
Copy link
Author

saas786 commented Oct 17, 2022

@saas786

I can't use develop

Why not?

Because it brings in in-progress / unstable code into my repo, I don't want to chase things down if something is not working as it should.
But if above fix is implemented and its released, I know what changes I am bringing in, and don't have to worry about it, as have been using 2.3.0 long time now.

@GaryJones
Copy link
Member

GaryJones commented Oct 17, 2022

So, you can use develop, but you choose not to.

You could, of course, pull in a particular commit: either the head of develop as it is today, or find where the fix was added that you're affected by and use that commit instead - that way the list of changes is fixed.

The three items you highlighted were fixed in #1984 and #1985. So 2fdc57f would include those fixes.

Here is the list of changes from 2.3.0 to 2fdc57f.

And the list of changes from 2fdc57f to the head of develop.

@saas786
Copy link
Author

saas786 commented Oct 17, 2022

So, you can use develop, but you choose not to.

Correct!

Awesome, thanks, that's better.

@MikeiLL
Copy link

MikeiLL commented Jan 3, 2023

If someone has a minute, could you please post how to upgrade to the develop version using Composer?

composer require wp-coding-standards/wpcs --dev

Doesn't seem to be doing the trick.

@jrfnl
Copy link
Member

jrfnl commented Jan 3, 2023

composer require wp-coding-standards/wpcs:"dev-develop"

You may need to add minimum-stability: dev as well.

@MikeiLL
Copy link

MikeiLL commented Jan 3, 2023

composer require wp-coding-standards/wpcs:"dev-develop" --dev to be specific

@MikeiLL
Copy link

MikeiLL commented Jan 4, 2023

@jrfnl would you mind telling me what dev-develop is derived from?

@jrfnl
Copy link
Member

jrfnl commented Jan 4, 2023

It's how Composer references non-tag branch names, so the develop branch becomes dev-develop and if you'd want to check out a particular WIP branch to, for instance, test a bug fix, a branch named feature/fix-bug-xyz would become dev-feature/fix-bug-xyz.

Does that answer your question ?

@MikeiLL
Copy link

MikeiLL commented Jan 4, 2023

Does that answer your question ?

@jrfnl Getting there. So dev-[branch-name](/[some-feature]) is a Composer syntax/feature, where is is checking for the string dev-?

You rock, by the way.

@jrfnl
Copy link
Member

jrfnl commented Jan 4, 2023

@jrfnl Getting there. So dev-[branch-name](/[some-feature]) is a Composer syntax/feature, where is is checking for the string dev-?

I think this page of the Composer documentation may help: https://getcomposer.org/doc/articles/aliases.md

You rock, by the way.

Always nice to hear ;-)

@jrfnl jrfnl added this to the 3.0.0 milestone Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants