Skip to content
Mark Sch edited this page May 23, 2020 · 25 revisions

PHPStorm

Recommended IDE (proprietary).

Versions

  • 2018.02: OK
  • 2018.03: Broken trait support!
  • 2019.01: OK
  • 2019.02: OK
  • 2019.03: OK
  • 2020.01: OK (!)

Must have

In Editor => General

  • Strip trailing spaces on save for "Modified lines".
  • Ensure line feed at file end of Save

In Editor => File Types

  • Add *.ctp to PHP (<= CakePHP 3.x only)

In Editor => Inspections => PHP

  • Code smell: Too many parameters in function declaration
  • Code style: uncheck Unecessary fully qualified name (we need this for doc blocks)
  • General: Static method called as dynamic, uncheck if you don't want to be alerted about PHPUnit code smells.
  • PHPDoc: Missing PHPDoc comment
  • Probable bugs: Assignment in condition

In Editor => CodeStyle => PHP

  • PHPDoc: Blank line before the first tag
  • PHPDoc => Generated Doc Blocks: Use fully-qualified class names
  • Blank Lines => Before return statement [1]
  • Code Conversion => Array Declaration Style: Force short declaration style
  • Code Conversion => Array Declaration Style: Add a comma after last element in multiline array

in Plugins:

Further links:

Nice to have

In Languages & Frameworks => PHP => Servers add a new Server with the current (.local) domain. Use the path mapping if you are using a vagrant box like "cakebox".

In Tools => External Tools you can set up cs-sniff and cs-fix and then assign them a keyboard shortcut.

Clone this wiki locally