Working with Zend Framework 2 using PhpStorm IDE, when using viewhelpers like inlineScript the syntax highlighting don't work properly:
The solution: use HEREDOC
To get PhpStorm code injection to work use HEREDOC to wrap the JavaScript code.
Now not only the syntax highlighting works fine, but in PhpStorm you can use "Edit JavaScript Fragment" to edit the JavaScript code and use code completion and other PhpStorm tools.