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

Fatal error: Uncaught TypeError: vsprintf() #34

Open
helgatheviking opened this issue Jun 28, 2023 · 5 comments
Open

Fatal error: Uncaught TypeError: vsprintf() #34

helgatheviking opened this issue Jun 28, 2023 · 5 comments

Comments

@helgatheviking
Copy link

Does this need a dependency update? I am seeing the following then trying to run the code checker sniffs:

PHP Fatal error: Uncaught TypeError: vsprintf(): Argument #2 ($values) must be of type array, string given in /home/helga/Sites/sandbox/wp-content/plugins/woocommerce-mix-and-match-products/vendor/squizlabs/php_codesniffer/src/Files/File.php:1056

using PHP 8.1.12 in Ubuntu

@andfinally
Copy link

Sounds similar to this old issue in the WP sniffs.

@helgatheviking
Copy link
Author

Hmm... yes, it does seem similar, but I am not sure how to patch woocommerce sniffs to get it to work with the dev branch of the WP Code standards.

@rrennick
Copy link

I am not sure how to patch woocommerce sniffs to get it to work with the dev branch of the WP Code standards.

If you fork the repo you could create a branch where you change the package version to dev-trunk. Then use your fork & branch (dev-BRANCHNAME) in your plugin composer.json.

@rogyw
Copy link

rogyw commented Aug 17, 2023

I got this error when using period (.) as the file list to check instead of *.php
e.g.

./vendor/bin/phpcs --standard=WordPress-Extra .

PHP Fatal error:  Uncaught TypeError: vsprintf(): Argument #2 ($values) must be of type array, string given in /vendor/squizlabs/php_codesniffer/src/Files/File.php:1056

Tried replacing . with *.php as shown below and the error does not occur:

./vendor/bin/phpcs --standard=WordPress-Extra *.php 

@helgatheviking
Copy link
Author

Could we give this some new impetus now that WP Code Standards are updated?

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

4 participants