This package provides phpcs without the struggle of installing all of its dependencies.
composer require --dev jin2chen/phpcs-phar
and use it like the original executable
vendor/bin/phpcs
Check out the main repo for more options and release notes https://github.com/squizlabs/PHP_CodeSniffer.