- 🇧🇩Bangladesh eashika
hello @mandclu, #34 could you please elaborate on the steps, please? I installed phpcs with homebrew as well and facing the same issue
- 🇮🇳India AnokR
Hello @all, I was having same error when downgrading the coder version to "8.3.13" run the command
composer require drupal/coder:8.3.13
fix my issue. #36 💬 On 8.3.14 (but not 8.3.13): ERROR: Referenced sniff "SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator" does not exist Active works for me.
Also after downgrading Coder to the
8.3.13
version you can upgrade it again to the latest one and Slevomat coding standards appear inphpcs -i
. At least it did a "trick" for me.- 🇺🇸United States AaronBauman Philadelphia
after R'ing TFA, I realized I needed to make a couple updates to my project's composer.json to get this working on latest coder stable.
Remove any config-set step from composer.json:
bin/phpcs --config-set installed_paths vendor/drupal/coder/coder_sniffer
Then remove dependencies which are now integrated with this module:
composer remove squizlabs/php_codesniffer dealerdirect/phpcodesniffer-composer-installer composer update drupal/coder -W
Good to go after that.
Thank you, @geoanders. I downgraded coder (composer global require drupal/coder:8.3.13) and it fixed the issue right away.
#18 worked for me thank you @geoanders
- 🇹🇭Thailand Nick Hope
The downgrade-then-upgrade trick in #37 worked for me.
Downgrade to 8.3.13:
composer global require drupal/coder:8.3.13
Upgrade to the latest version (currently 8.3.13):
composer global require drupal/coder
Verify installed coding standards:
phpcs -i
outputs (for me):
The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend, Drupal, DrupalPractice, VariableAnalysis and SlevomatCodingStandard
- 🇬🇧United Kingdom jonnyhocks
Just to expand on #33 💬 On 8.3.14 (but not 8.3.13): ERROR: Referenced sniff "SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator" does not exist Active , I was also experiencing the issue with PHPStorm even though the issue had been resolved when running with CLI.
I removed the installed paths section from the .idea/php.xml file. I'm guessing that some config is saved in different places depending on which version of PHPStorm you are using.
- 🇦🇺Australia dynamdilshan
#18 worked for me as I followed the instructions from this resource below:
https://gorannikolovski.com/blog/referenced-sniff-slevomat-coding-standa...I'm on D9.5, PHP 8.1 and the latest version of coder module.
- 🇺🇸United States selwynpolit
Just to elaborate on #42. I found that by editing the .idea/php.xml file, even while PHPStorm is open, and removing the line:
<option name="installedPaths" value="$PROJECT_DIR$/vendor/drupal/coder/coder_sniffer" />
from the section displayed below, the error immediately went away.
<component name="PHPCodeSnifferOptionsConfiguration"> <option name="codingStandard" value="Drupal" /> <option name="highlightLevel" value="WARNING" /> <option name="installedPaths" value="$PROJECT_DIR$/vendor/drupal/coder/coder_sniffer" /> <option name="useInstalledPaths" value="true" /> <option name="transferred" value="true" /> </component>
- 🇮🇳India Sivaji_Ganesh_Jojodae Chennai
#36 works. Downgrading drupal/coder (8.3.21 => 8.3.13).
- 🇧🇬Bulgaria pfrenssen Sofia
Changing this to a support request since this is not a bug in coder but rather a configuration issue on the user side.
- 🇫🇷France fgm Paris, France
Seeing how it's so common since it happens as the default in the most popular IDE, I would say it's rather a bug, but that's your call.
- 🇺🇸United States TomTech
I just encountered this issue.
You shouldn't need to edit any PhpStorm XML files. There is a setting for this.
Seems that JetBrains was being helpful, as this is configuration specifically documented for this module(and similar implementations): PHP - Quality Tools - PHP Code Sniffer.
You can clear the field and uncheck the "Installed standards path" to remove this setting in PhpStorm.
Seems some communication should be made with JetBrains that the latest version of coder requires multiple paths, not a single path. (Or could we just symlink the other directories into the coder directory as an alternative?)
- 🇺🇸United States j. ayen green
@TomTech #49 (using ddev and PhPStorm) ... I owe you a beer!
- 🇺🇸United States selwynpolit
Hopefully I captured the steps correctly here to save others some time: https://selwynpolit.github.io/d9book/setup_mac#code-sniffing
- 🇬🇧United Kingdom alexharries
Hmm, I'm not having any luck fixing this issue on the command line or in PHPStorm despite following the steps in #44 and Selwynpolit's guide (thank you for the guide! Very helpful).
Following in hope of a resolution :)
Alex
- 🇺🇸United States selwynpolit
@alexharries, did you try installing Drupal dev tools in your project with `composer require drupal/core-dev` ?
- 🇺🇸United States selwynpolit
I learned some new thing about how to make this work with PHPStorm. Details at https://selwynpolit.github.io/d9book/setup_mac#code-sniffing
- 🇦🇺Australia skyejohnson Sunshine Coast, Australia
Many thanks for the guide @selwynpolit, it fixed this issue for me in PHPStorm just now.