Skip to content
Mark Scherer edited this page Apr 11, 2023 · 23 revisions

PHPStorm

Recommended IDE (proprietary).

Versions

  • 2018.3: Broken trait support!
  • 2019.1: OK
  • 2019.2: OK
  • 2019.3: OK
  • 2020.1: OK
  • 2020.2: OK
  • 2020.3: 2020.3.1+ recommended for meta support fully working
  • 2021.1: OK
  • 2021.2: OK
  • 2022.x: OK
  • 2023.x: OK

Must have

In Editor => General

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

In Editor => Inspections => PHP

  • Code smell: Too many parameters in function declaration
  • Code style: uncheck Unnecessary 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.

Further Keyboard Adjustments

Assign back/forward jumping in the code, e.g.

  • SHFT+CTRL+Left => Jumping one step back
  • SHFT+CTRL+Right => Jumping one step forward again

Outdated

(CakePHP 3 or below)

In Editor => File Types

  • Add *.ctp to PHP (<= CakePHP 3.x only)
Clone this wiki locally