How to auto-import namespaces for whole PHP file in phpStorm?
Its called "Optimize imports" and can be found in menu Code>Optimize imports. You can set keyboard shortcut for that. I have imported keyboard shortcuts from NetBeans so it remained the same, but the functionality is sometimes different than in NetBeans.
Currently you can't do this for a whole file. You are able to import on the fly, as documented here, but not for a pre-existing file. You might consider making a feature request for this.