Dark side propaganda
SYMFONY PHP COMBO
Adds code completion, inspections and more to composer.json file.
Simply put your .editorconfig file(s) in place according to the instructions at editorconfig.org site, and the plugin will enforce them.
EditorConfig settings will silently override the normal settings configured in the IDE for all files controlled by EditorConfig.
That is, if your IDE's settings say to use 4-space indents in Java files, but your EditorConfig settings enforce 2-space indents in all the files under the "src" directory, then hitting tab will insert 2 spaces on Java files in "src", but 4 spaces in all other Java files in the project.
highlight & completion
Some useful snippets for lazyness
Bootstrap 3 live templates / snippets
KEYBOARD SHORTCUTS DEPENDS ON YOUR OS AND KEYMAP SETTINGS
KEYBOARD SHORTCUTS WITH A RED BACKGROUND ARE MY RECOMMANDATIONS FOR NEWCOMERS
CMD + SHIFT + F
CTRL + SHIFT + F
CMD + F
CTRL + F
SEARCH in files
Did you know that for easy finding you can type only the camel cased letters ?
CMD + SHIFT + G
SHIFT + F3
CMD + G
SEARCH & REPLACE
CMD + SHIFT + R
CTRL + SHIFT + R
CMD + R
CTRL + R
SEARCH & Replace in files
Did you know that for easy finding you can use regex like *.twig ?
FIND EVERYTHING !
SHIFT + SHIFT
SHIFT + SHIFT
Great command to learn when you start to use PhpStorm
This shortcut is great because you search across files, classes, commands, symbols etc
... IT COMES with a serious performance cost
SO IF YOU HAVE SLOW MACHINE OR ARE A LITTLE BIT PERFECTIONIST
LEARN THE DEDICATED COMMANDS !
CMD + SHIFT + O
CMD + O
CMD + SHIFT + A
CTRL + SHIFT + A
CMD + ALT + O
GO TO LINE
CMD + L
CTRL + G
When you're searching a file you can use
this kind of syntax to reach a particular line :
Go to declaration
An important thing to learn is marking directory in PhpStorm AT LEAST :
(Right click on a folder)
Excluded : exclude the directory from parsing, in symfony project for example exclude the cache and logs folder
Resource Root : tell PhpStorm where he can find resources ( / ), for example you have multiple warnings in your css because PhpStorm can't find all images resources, mark the web directory of your symfony project as a Resource Root, now PhpStorm will find and correctly assist you. (same thing for, for example, a project with a funky setup on twig template)
ALT + ENTER
ALT + ENTER
Great command to learn when you see a light bulb or some "yellow waves" do the shortcut and see what PhpStorm propose to help you.
It really does MANY things depending the context so have a try !
Quick and nice way for writing html
Link to emmet cheat sheet at the end in the ressources part.
You can make a combo with emmet too
Alt + Insert
Live template are a feature turning a keyword to a bunch of code.
Example in a twig context
To see available live templates and create your own
GO To PHPSTORM SETTINGS, TYPE "Live template' in the search input on the top left
Alt + CLICK
Tip : If you click and drag you can select by "column"
Paste from history
CMD +ALT+ SHIFT + C
When yo do this on a file you get this in your clipboard : src/AppBundle/Resources/public/assets/css/admin.css
When yo do this on a class name you get this in your clipboard : \AppBundle\Form\ProductType
If you need the full path use the copy path command :
COPY PATH (with project file or folder selected)
CMD + SHIFT + C
Help > Tip of the day
Help > productivity guide
FROM PHPSTORM IDE
Thank you !
Becoming a phpstorm trooper
By Sylvain Combes