Besides, you should probably set this variable unconditionally, that is, outside of `(when …)`.  

Otherwise it is not set if phpcs is not installed when Flycheck Mode is first enabled in a buffer, and so the variable has the wrong value when phpcs is installed later on while the buffer is still alive.  

Given that some users tend to have Emacs running for days, if not weeks, with buffers open for all this time, I think, this scenario should be handled.