Snippet to fast create docblock for enum using library https://github.com/myclabs/php-enum.
- PHPStorm > Settings > Editor > Live Templates
- Add new snippet
- Abbreviation:
cEnumDocBlock
- Description:
Create ENUM docblock
- Template Text:
/**
$CLASS_NAME$
*/$END$
- Edit variables
- Expression:
groovyScript("File inputFile = new File(_1);LineNumberReader reader = inputFile.newReader(); def somValue = ''; while ((line = reader.readLine()) != null) { def cleanLine = line.trim(); def m = cleanLine =~ /private const\\\s(.*)\\\s=/; if (m.size() > 0) { somValue = somValue + ' * @method static ' + _2 + ' ' + m[0][1] + '''()\n'''; }; }; return somValue + '';", filePath(), phpClassName())