Export PhpStorm Advanced Metadata from DI containers

3.0.0 2023-01-14 11:51 UTC


Packagist license Code Climate Gitlab pipeline status Codecov

Export PhpStorm Advanced Metadata from DI containers to enable code completion.

The library is inspired by Pimple Container Dumper for Silex, but it doesn't require IDE plugin because it uses native PhpStorm export format. It can integrate with any PSR-15 compliant framework and is extensible to support more DI containers and frameworks in the future.


Install by composer

composer require arokettu/phpstorm-metadata-export --dev

Container Support

Supported containers:

Integration middlewares for:



$container = new \DI\Container();
// .phpstorm.meta.php must be in a root path of your project
$storePath = __DIR__ '/.phpstorm.meta.php/sandfox_container_export.meta.php';

// just generate the file content
$metaPhp = \Arokettu\PhpStorm\Metadata\Generator::get([$container]);
file_put_contents($storePath, $metaPhp);

// use middleware (Slim 4 example)
$app = new \Slim\App();
$app->addMiddleware(new \Arokettu\PhpStorm\Metadata\Integration\ContainerExportMiddleware($container, [
    'filename' => $storePath,


Read full documentation at

Also on Read the Docs:


Please file issues on our main repo at GitLab:

Feel free to ask any questions in our room on Gitter:


The library is available as open source under the terms of the MIT License. See