I really need to check php compatibility

In this video we will check for php compatibility on one of my old project and different versions of WordPress.

First we need the CodeSniffer tooling, we will download it will wget.

wget https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar

Next we make the CodeSniffer checker executable.

chmod +x phpcs.phar

The plugin is fetched directly from github release page. Currently the 9.3.5 is the most recent but you might want to check for a newer.

wget https://github.com/PHPCompatibility/PHPCompatibility/archive/refs/tags/9.3.5.tar.gz

Let's unpack the tooling.

tar -xvzf 9.3.5.tar.gz

This command is what I run in the video. This works if your tooling and plugin is located in the directory parent of your current directory. What you don't want is to have the plugin in the same directory as you are checking or the checker will load the classes twice.

../phpcs.phar --extensions=php -p . --standard=../PHPCompatibility-9.3.5/PHPCompatibility --runtime-set testVersion 5.5

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.