Search code examples
phpapacheyiiphpstormcase-sensitive

Force case sensitive method calls


So when I commit my code I have sometimes left in method calls like CLASSNAME::fooBar. The way I should be calling it is Classname::fooBar. My co worker said he changed something years ago that he cant remember to force his environment to kick him back if he does this. I've also been told that production is case sensitive. My local environment does not care about case sensitivity but I need it to.

I honestly don't care how I solve this but I'd like to stop facepalming everytime I miss this. I'd even accept a solution on the PhpStorm level.


Solution

  • PhpStorm has an inspection for that -- you just need to activate it.

    • Settings (Preferences on macOS) | Editor | Inspections
    • PHP | Code Smell | Case mismatch in method call or class usage

    enter image description here

    enter image description here