Skip to content

Commit

Permalink
Migration guide improvements
Browse files Browse the repository at this point in the history
Signed-off-by: George Steel <[email protected]>
  • Loading branch information
gsteel committed Jul 3, 2023
1 parent 0d10e42 commit ce3df18
Showing 1 changed file with 31 additions and 5 deletions.
36 changes: 31 additions & 5 deletions docs/book/v3/migration/v2-to-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,47 @@
laminas-filter version 3 makes a number of changes that may affect your application.
This document details those changes, and provides suggestions on how to update your application to work with version 3.

## Removed Filters & Features
## Removed Filters

These filters were deprecated in the 2.0.x series of releases and have now been removed:
The following filters were deprecated in the 2.0.x series of releases and have now been removed:

### Encryption and Decryption related filters

These filters had become outdated. We recommend that you make use of a maintained encryption library and [write your own filters](../writing-filters.md) if you need to encrypt or decrypt content using the `FilterInterface` contract.

- `Laminas\Filter\File\Decrypt`
- `Laminas\Filter\File\Encrypt`
- `Laminas\Filter\Blacklist`
- `Laminas\Filter\Decrypt`
- `Laminas\Filter\Encrypt`
- `Laminas\Filter\StaticFilter`
- `Laminas\Filter\Whitelist`

### Static Filter

`Laminas\Filter\StaticFilter` has been removed without replacement. Most filters are "new-able" so similar behaviour can be accomplished with:

```php
$filtered = (new \Laminas\Filter\HtmlEntities())('Nuts & Bolts');
```

For filters requiring more complex construction, we encourage you to make use of dependency injection and compose the filter itself, or the `FilterPluginManager`, for example:

```php
$pluginManager = $container->get(\Laminas\Filter\FilterPluginManager::class);
$filter = $pluginManager->get(\Laminas\Filter\HtmlEntities::class);
$filtered = $filter->filter('A String');
```

### Whitelist & Blacklist Filters

- `Laminas\Filter\Whitelist` has been replaced by [`Laminas\Filter\AllowList`](../standard-filters.md#allowlist)
- `Laminas\Filter\Blacklist` has been replaced by [`Laminas\Filter\DenyList`](../standard-filters.md#denylist)

## Removed Features

`Laminas\Filter\Compress` no longer supports the compression formats `Lzf`, `Rar` and `Snappy`.
Support for these formats has been removed so the following classes are no longer available:

- `Laminas\Filter\Compress\Lzf`
- `Laminas\Filter\Compress\Rar`
- `Laminas\Filter\Compress\Snappy`

The following compression formats are still available: `Bz2`, `Gz`, `Tar` and `Zip`

0 comments on commit ce3df18

Please sign in to comment.