Make I18N sniff compatbile with PHP8.1+

This is a hacky workaround to enable us to use the translation sniffs in a PHP 8 environment. We can get rid of
it, once the coding standards are compatible.

[MAILPOET-4524]
This commit is contained in:
David Remer
2022-08-04 15:16:17 +03:00
committed by Veljko V
parent 45b344727c
commit 402cf63e6b

View File

@@ -27,6 +27,10 @@
"scripts": {
"pre-autoload-dump": [
"cd vendor/wporg/plugin-directory && rm -rf vendor && mkdir vendor && ln -s ../../../wp-coding-standards vendor/wp-coding-standards"
],
"post-install-cmd": [
"sed -i \"s/trim( PHPCSHelper::get_config_data( 'text_domain' ) )/PHPCSHelper::get_config_data( 'text_domain' )/\" vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/I18nSniff.php",
"echo '\\033[0;31m We need to remove the trim in the coding standards until v3 of the WordPress coding standards are available.'"
]
}
}