Skip to content

Commit

Permalink
Amend documentation and migration guide
Browse files Browse the repository at this point in the history
Signed-off-by: George Steel <[email protected]>
  • Loading branch information
gsteel committed Dec 4, 2024
1 parent abff8c3 commit 9bdc456
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Providing Filters via Modules

If you wish to indicate that your laminas-mvc module provides filters, have your `Module` class implement `Laminas\Filter\FilterProviderInterface`, which defines the method:
If you wish to indicate that your laminas-mvc module provides filters, have your `Module` class implement `Laminas\ModuleManager\Feature\FilterProviderInterface`, which defines the method:

```php
/**
Expand All @@ -11,6 +11,8 @@ public function getFilterConfig();

The method should return an array of configuration following the [laminas-servicemanager configuration format](https://docs.laminas.dev/laminas-servicemanager/configuring-the-service-manager/).

Further information can be found in the [Module Manager documentation](https://docs.laminas.dev/laminas-modulemanager/module-manager/#servicelistener).

If you are not using laminas-mvc, but are using a dependency injection container (e.g., if you are using Mezzio), you can also provide filters using the top-level `filters` configuration key; the value of that key should be laminas-servicemanager configuration, as linked above.

(laminas-mvc users may also provide configuration in the same way, and omit implementation of the `FilterProviderInterface`.)
5 changes: 5 additions & 0 deletions docs/book/v3/migration/v2-to-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,3 +278,8 @@ Various filters such as `StringToLower` and `StringToUpper` inherited from the a
This class has been removed and the affected filters no longer inherit from anything.
In order to provide consistent handling of the `encoding` option that has been re-implemented in these filters, a new class `EncodingOption` has been introduced which provides static methods to validate a given encoding option.
This change is unlikely to affect you, unless you have inherited from this class. In which case, you will need to implement the provision of an encoding option for your custom filter and remove `AbstractUnicode` from your inheritance tree.

### Removal of the `FilterProviderInterface`

This legacy interface is related to Laminas MVC Module Manager integration and was superseded by `Laminas\ModuleManager\Feature\FilterProviderInterface`.
If your code still references `Laminas\Filter\FilterProviderInterface`, replace its usage with the interface [shipped by Module Manager](https://docs.laminas.dev/laminas-modulemanager/module-manager/#servicelistener).

0 comments on commit 9bdc456

Please sign in to comment.