Skip to content

Commit

Permalink
docs: minor changes in preparation for merging for 2.10.0
Browse files Browse the repository at this point in the history
- one sentence per line
- reference "since 2.10.0" for new features

Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
  • Loading branch information
weierophinney committed Feb 17, 2021
1 parent c4f2b38 commit 1c57f1b
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions docs/book/plugin-manager.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
# Plugin Manager

The `AdapterPluginManager` extends the laminas-servicemanager
`AbstractPluginManager`, and has the following behaviors:
The `AdapterPluginManager` extends the laminas-servicemanager `AbstractPluginManager`, and has the following behaviors:

- It will only return `Laminas\Serializer\Adapter\AdapterInterface` instances.
- It defines short-name aliases for all shipped serializers (the class name minus
the namespace), in a variety of casing combinations.
- **Since 2.10.0**: It defines short-name aliases for all shipped serializers (the class name minus the namespace), in a variety of casing combinations.
- All services are shared by default; a new instance will only be created once and shared each time you call `get()`.

## Factory

`Laminas\Serializer\AdapterPluginManager` is mapped to the factory
`Laminas\Serializer\AdapterPluginManagerFactory` when wired to the dependency
injection container.
`Laminas\Serializer\AdapterPluginManager` is mapped to the factory.
`Laminas\Serializer\AdapterPluginManagerFactory` when wired to the dependency injection container.

The factory will be automatically registered when loading/installing the `Laminas\Serializer` module in `laminas-mvc` and/or loading/installing the `ConfigProvider` into a Mezzio application.

The factory will look for the `config` service, and use the `serializers`
configuration key to seed it with additional services. This configuration key
should map to an array that follows [standard laminas-servicemanager configuration](https://docs.laminas.dev/laminas-servicemanager/configuring-the-service-manager/).
Since version 2.10.0, the factory will look for the `config` service, and use the `serializers` configuration key to seed it with additional services.
This configuration key should map to an array that follows [standard laminas-servicemanager configuration](https://docs.laminas.dev/laminas-servicemanager/configuring-the-service-manager/).

To add your own serializer you can add the following configuration:

```php
// config/autoload/serializers.global.php
return [
return [
'serializers' => [
'factories' => [
\App\MyCustomSerializer::class => \App\Container\MyCustomSerializerFactory::class,
Expand Down

0 comments on commit 1c57f1b

Please sign in to comment.