-
-
Notifications
You must be signed in to change notification settings - Fork 39
PHPStorm
Mark Scherer edited this page Apr 11, 2023
·
23 revisions
Recommended IDE (proprietary).
- Demo Video: https://streamable.com/nnqzg
- Demo Video element() autocomplete (NEW): https://streamable.com/ixrbg
- Live Demo: https://youtu.be/a7EQvHkIb60?t=2119 (+ end of the video again)
- 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
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
:
- Add
EditorConfig
plugin and activate it inEditor
=>Code Style
=>Enable EditorConfig support
- Add https://plugins.jetbrains.com/plugin/9927-deep-assoc-completion plugin (super useful!)
Further links:
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.
Assign back/forward jumping in the code, e.g.
- SHFT+CTRL+Left => Jumping one step back
- SHFT+CTRL+Right => Jumping one step forward again
(CakePHP 3 or below)
In Editor
=> File Types
- Add
*.ctp
to PHP (<= CakePHP 3.x only)