Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
arokettu committed Jan 18, 2021
1 parent f7b5017 commit 4d9d019
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 38 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 1.7.0

*Jan 18, 2021*

* Fix compatibility with Laminas ServiceManager 3.6
* Deprecate Silex support

## 1.6.0

*Aug 28, 2020*
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# PhpStorm Metadata Export

[![Packagist](https://img.shields.io/packagist/v/sandfoxme/phpstorm-metadata-export.svg)](https://packagist.org/packages/sandfoxme/phpstorm-metadata-export)
[![license](https://img.shields.io/github/license/sandfoxme/phpstorm-metadata-export.svg)](https://opensource.org/licenses/MIT)
[![Code Climate](https://img.shields.io/codeclimate/maintainability/sandfoxme/phpstorm-metadata-export.svg)](https://codeclimate.com/github/sandfoxme/phpstorm-metadata-export)
[![Packagist](https://img.shields.io/packagist/v/sandfoxme/phpstorm-metadata-export.svg?style=flat-square)](https://packagist.org/packages/sandfoxme/phpstorm-metadata-export)
[![license](https://img.shields.io/github/license/sandfoxme/phpstorm-metadata-export.svg?style=flat-square)](https://opensource.org/licenses/MIT)
[![Code Climate](https://img.shields.io/codeclimate/maintainability/sandfoxme/phpstorm-metadata-export.svg?style=flat-square)](https://codeclimate.com/github/sandfoxme/phpstorm-metadata-export)

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

Expand All @@ -27,19 +27,19 @@ Supported containers:

* [Pimple]
* [PHP-DI]
* [Laminas ServiceManager] / [Zend ServiceManager] (experimental)
* [Laminas ServiceManager] / [Zend ServiceManager] (unstable)

Integration middlewares for:

* [Slim]
* [Silex]
* [PSR-15] (Zend Expressive, Mezzio, Slim 4, ...)
* [PSR-15] (Mezzio, Slim 4, ...)
* [Slim 3]
* [Silex] (deprecated)

[Pimple]: https://pimple.symfony.com/
[PHP-DI]: http://php-di.org/
[Laminas ServiceManager]: https://docs.laminas.dev/laminas-servicemanager/
[Zend ServiceManager]: https://docs.zendframework.com/zend-servicemanager/
[Slim]: https://www.slimframework.com/
[Slim 3]: https://www.slimframework.com/
[Silex]: https://silex.symfony.com/
[PSR-15]: https://www.php-fig.org/psr/psr-15/

Expand Down
67 changes: 37 additions & 30 deletions docs/main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,34 @@ Using Generator directly
[$container]
);
Slim
----
PSR-15
------

Version 1.1 adds Psr15 compliant middleware implementation like Slim 4 or Mezzio.
It generally uses the same approach as the earlier Slim Middleware.
The classname is ``SandFox\PhpStorm\Metadata\Integration\Psr15\ContainerExportMiddleware``.

.. code-block:: php
<?php
use SandFox\PhpStorm\Metadata\Integration\Psr15\ContainerExportMiddleware;
$middleware = new ContainerExportMiddleware($container);
// You can also override metadata filename like this
$middleware = new ContainerExportMiddleware($container, [
// it is a good idea to use full path here
'filename' => '/path/to/project/.phpstorm.meta.php/my_export_file.meta.php',
]);
// Register middleware the way your compliant framework allows it
$myPsr15CompliantApp->registerMiddleware($middleware);
Slim 3
------

.. note:: Slim 4 can also use this middleware but PSR-15 is preferable

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

Expand All @@ -101,6 +127,10 @@ Add middleware class ``SandFox\PhpStorm\Metadata\Integration\Slim\ContainerExpor
Silex
-----

.. warning::
This class is deprecated since 1.7.0 and will be removed in 2.0.
You should use neither this middleware nor Silex itself.

Add service provider class ``SandFox\PhpStorm\Metadata\Integration\Silex\ContainerExportProvider`` to your Silex app.

.. code-block:: php
Expand All @@ -120,29 +150,6 @@ Add service provider class ``SandFox\PhpStorm\Metadata\Integration\Silex\Contain
'phpstorm.metadata.filename' => '/path/to/project/.phpstorm.meta.php/my_export_file.meta.php',
]);
Psr15
-----

Version 1.1 adds Psr15 compliant middleware implementation. It generally uses the same approach as Slim Middleware.
The classname is ``SandFox\PhpStorm\Metadata\Integration\Psr15\ContainerExportMiddleware``.

.. code-block:: php
<?php
use SandFox\PhpStorm\Metadata\Integration\Psr15\ContainerExportMiddleware;
$middleware = new ContainerExportMiddleware($container);
// You can also override metadata filename like this
$middleware = new ContainerExportMiddleware($container, [
// it is a good idea to use full path here
'filename' => '/path/to/project/.phpstorm.meta.php/my_export_file.meta.php',
]);
// Register middleware the way your compliant framework allows it
$myPsr15CompliantApp->registerMiddleware($middleware);
License
=======

Expand All @@ -153,13 +160,13 @@ See LICENSE.md
.. _Pimple Container Dumper: https://github.com/Sorien/silex-pimple-dumper
.. _MIT License: https://opensource.org/licenses/MIT

.. |Packagist| image:: https://img.shields.io/packagist/v/sandfoxme/phpstorm-metadata-export.svg
.. |Packagist| image:: https://img.shields.io/packagist/v/sandfoxme/phpstorm-metadata-export.svg?style=flat-square&
:target: https://packagist.org/packages/sandfoxme/phpstorm-metadata-export
.. |GitHub| image:: https://img.shields.io/badge/get%20on-GitHub-informational.svg?logo=github
.. |GitHub| image:: https://img.shields.io/badge/get%20on-GitHub-informational.svg?style=flat-square&logo=github
:target: https://github.com/arokettu/phpstorm-metadata-export
.. |GitLab| image:: https://img.shields.io/badge/get%20on-GitLab-informational.svg?logo=gitlab
.. |GitLab| image:: https://img.shields.io/badge/get%20on-GitLab-informational.svg?style=flat-square&logo=gitlab
:target: https://gitlab.com/sandfox/phpstorm-metadata-export
.. |Bitbucket| image:: https://img.shields.io/badge/get%20on-Bitbucket-informational.svg?logo=bitbucket
.. |Bitbucket| image:: https://img.shields.io/badge/get%20on-Bitbucket-informational.svg?style=flat-square&logo=bitbucket
:target: https://bitbucket.org/sandfox/phpstorm-metadata-export
.. |Gitea| image:: https://img.shields.io/badge/get%20on-Gitea-informational.svg
.. |Gitea| image:: https://img.shields.io/badge/get%20on-Gitea-informational.svg?style=flat-square&logo=gitea
:target: https://sandfox.org/sandfox/phpstorm-metadata-export

0 comments on commit 4d9d019

Please sign in to comment.