PhpStorm hacks for developers

PhpStorm is the most popular IDE for professional OXID developers.
Here we will collect some useful hacks to make your coding experience even better.

configure PHP version and smarty delimiters

this will help PhpStorm find possible compatibility issues in your code and correctly understand OXID’s templates.

  1. open settings and type “php language level”, then select the php version.
  2. go to settings and type “smarty” into the search bar, then select the bottom “smarty” menu item, input oxid’s custom smarty delimiters and uncheck “Smarty 3 whitespace policy”:

resolving dynamic paths

OXID provides multiple functions for retrieving correct paths to different directories, e.g. $oConfig->getModulesDir() for modules directory.
But PhpStorm needs some help to resolve them, otherwise you will see errors like this:


mapping your _parent classes to the actual oxid classes

when extending OXID classes with modules, you have to use class declaration like this:
class myArticle extends myArticle_parent but since there is no class “myArticle_parent” available, PhpStorm can not resolve methods from parent classes.
To fix this, simply add a new “.ide-helper.php” file to your module, where you map *_parent classes to the actual class you are extending, like this:

namespace VanillaThunder\DevUtils\Application\Extend;
class Email_parent extends \OxidEsales\Eshop\Core\Email {}
class Language_parent extends \OxidEsales\Eshop\Core\Language {}

code inspections might prevent some stupid situations

lets not lie: we all copy-paste code from stackoverflow and other sources.
Sometimes the code was made for a different php version and might not work in current project or it might even contain some… more substancial issues.
Code inspections will help you identifying problems in code, like version incompatibilities or missing function arguments.
Overall code inspections will improve the quality and maintainability of your code.

You also might want to have a look at this extension: Php Inspections (EA Extended)
It provides some additional useful checks like:

  • duplicated methods, that exist in parent class
  • possible null pointer exceptions
  • undefined classes and methods
    (very useful if you copy-paste older code from this forum into newer OXID versions)


  1. get CSS class names autocompletion

    unfortunately PhpStorm does not understand OXID’s oxscript and ‘oxstyle’ tags, so it uses all avaialble stylesheets for populating autocompletion, which is not really helpful:

    To fix this, we have to add some “dead” code to our template just to let PhpStorm know, which files we use in this template:
    [{if 1 > 2}]<link rel="stylesheet" href="../relative/path/to/your/stylesheet.css">[{/if}]
    At the current state of math and human common sense 1 will never be greater than 2, so this code will never appear in templates, but PhpStorm is OK with that.
  2. Fully Qualified Class Name Completion

    lets say, you need a new instance of Order class in your code.
    You usually would type something like this $oOrder = oxNew(Order); and wait for PhpStorm to suggest the FQDN for you. This might work in shops without modules, but in a customized shop with couple of modules the actually wanted FQDN-suggestion \OxidEsales\Eshop\Application\Model\Order might be not even under the first 10 suggestions.
    But there is a trick for this: type all the capital letters of namespaces and PhpStorm will find the namespace and class matching those capital leters for you, e.g. for
    type “OEEAMO” or “OEEAMOrder” and you will get better FQDN suggestions:

    Source: Fully Qualified Class Name Completion | The PhpStorm Blog

Continue the discussion at --> OXID forums