I failed to find any information on how to change file type dynamically for PhpStorm. For example I need to deal with HTML files, which could have some PHP, Twig markup, embedded JS at the same time.
It is of course possible to choose the type via Preferences -> File Types, but the pattern can be registered for one file type only, and this is a problem.
It is not possible to enable multiple types for a single file, and it is not convenient at all to switch types via settings all the time.