Skip to content

Commit ceeaafd

Browse files
committed
Explain containers and Generator class a bit
1 parent 56177e4 commit ceeaafd

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,52 @@ Install by composer
1919
composer require sandfoxme/phpstorm-metadata-export --dev
2020
```
2121

22+
## Containers
23+
24+
### Pimple
25+
26+
The library has full support for the Pimple DI version 3.*
27+
28+
### Zend ServiceManager
29+
30+
The library has partial support for the Zend ServiceManager. Please note that there's no open and public way
31+
of iterating over SM entries so the implementation is tied to the internal structure not covered by
32+
the semantic version compatibility promise. Feel free to open an issue if it is broken for some scenario
33+
34+
Obviously the implementation also cannot create hints for abstract factories
35+
36+
The library is tested against Zend SM version 3.3 and should work with any 3.* version
37+
2238
## Usage
2339

24-
The library supports Pimple DI and has integration classes available for Slim and Silex.
40+
The library has integration classes available for Slim and Silex.
2541
By default exporter will create directory `.phpstorm.meta.php` in the root path of your project
2642
(where `vendor` directory is) and put metadata file to it on every request.
2743
It is a good idea to enable integration components only in development environment.
2844
Don't forget to gitignore your `.phpstorm.meta.php` directory.
2945

46+
### Using Generator directly
47+
48+
```php
49+
<?php
50+
51+
use SandFoxMe\PhpStorm\Metadata\Generator;
52+
53+
$container = new Container();
54+
55+
file_put_contents(
56+
'/path/to/project/.phpstorm.meta.php/my_export_file.meta.php',
57+
Generator::get([$container])
58+
);
59+
60+
// OR
61+
62+
Generator::store(
63+
'/path/to/project/.phpstorm.meta.php/my_export_file.meta.php',
64+
[$container]
65+
);
66+
```
67+
3068
### Slim
3169

3270
Add middleware class `SandFoxMe\PhpStorm\Metadata\Integration\Slim\ContainerExportMiddleware` to your Slim app.

0 commit comments

Comments
 (0)