When setting up PHPCS using the examples create on Drupal.org I found the following error keep stopping me testing modules in Drupal Core.
ERROR: Referenced sniff "SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator" does not exist
By creating two aliases in my .bash_profile it allowed the operating system to see PHPCS and PHPCPF. Which intern worked seamlessly.
alias phpcs="php ~/.composer/vendor/bin/phpcs" alias phpcbf="php ~/.composer/vendor/bin/phpcbf"
When running PHPcs -i you should see the result below.
The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend, Drupal, DrupalPractice, VariableAnalysis and SlevomatCodingStandard