Xdebug triggered by Code Sniffer (PHPCS) in PHPStorm
Asked Answered
Q

3

10

I have both xdebug and PHP_CodeSniffer (PHPCS) working great on my installation of PHPStorm, but the one really annoying part is that the debugger now seems to be treating Code Sniffer errors as breakpoints and interrupts the code to let me know of style warnings while I'm trying to test out code. What can I do to prevent Code Sniffer from being caught by the remote debugger in PHPStorm?

PS: I'm running Apache, using virtual hosts to map certain URLs to folders on my computer, and code sniffer never triggered PHPStorm's remote debugger explicitly, while my site caused PHPStorm to ask me if I wanted to include it's virtual URL for debugging.

The problem also happens with Mess Detector (PHPMD) and PHPStan.

Quiroz answered 17/7, 2012 at 17:49 Comment(0)
D
35

I had a similar problem and I solved it like this: - went to "Project settings" -> "PHP" -> "Debug" - under "XDebug" I unchecked the two "Force ..." options.

enter image description here

Hope it does the trick for you.

Disinterested answered 26/7, 2013 at 9:42 Comment(0)
B
0

If you need XDebug to keep intercepting requests except ones from Code Sniffer, you can set up exclusions:

PHPStorm settings > PHP > Debug > Skipped paths > + > .../vendor/bin/phpcs or wherever your phpcs launcher is.

Barham answered 4/7 at 15:58 Comment(0)
P
-2

I have added "-dxdebug.remote_enable=0" argument in last line of phpcs.bat and phpcbf.bat.

"%PHPBIN%" -dxdebug.remote_enable=0 "%~dp0\phpcbf" %*
Puberulent answered 12/8, 2020 at 10:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.