Created
January 7, 2015 21:28
-
-
Save deviantintegral/6ba68d6bfcb0d27d1a92 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Find all entity controller classes. | |
| $info = entity_get_info(); | |
| $controller_meta = array(); | |
| foreach ($info as $entity_type => $data) { | |
| $controller_meta[] = "'$entity_type' instanceof \\" . $data['controller class'] . ','; | |
| } | |
| $mappings = implode("\n ", $controller_meta); | |
| $meta = <<<EOD | |
| <?php | |
| /** | |
| * Place this file somewhere within your project. JetBrains recommends naming | |
| * the file .phpstorm.meta.php. Multiple files can be used to split this | |
| * metadata among different modules | |
| * | |
| * PHPStorm 8 is required. It should automatically updates when this file is | |
| * changed, but if it doesn't use File -> Invalidate Caches to rebuild the | |
| * completion index. | |
| */ | |
| namespace PHPSTORM_META { | |
| /** @noinspection PhpUnusedLocalVariableInspection */ | |
| /** @noinspection PhpIllegalArrayKeyTypeInspection */ | |
| \$STATIC_METHOD_TYPES = [ | |
| \\entity_get_controller('') => [ | |
| $mappings | |
| ], | |
| ]; | |
| } | |
| EOD; | |
| print $meta; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment