Using multiple filters with priority in ZF2

Code
<?php

use Zend\Filter;

$value ',,--string,,..,';

$filterChain = new Filter\FilterChain();

// attach different filters and their priority
$filterChain->attach(new Filter\StringToUpper());
$filterChain->attach(new Filter\StringTrim(',.'), 1);
// because of priority, this filter has no "-" char to trim
$filterChain->attach(new Filter\StringTrim('-'), 2);

echo 
$filterChain->filter($value);
Result
--STRING
Used Versions
PHP 7.1, Zend 3.0, Symfony 3.2, Laravel 5.2, PHPUnit 5.6, Doctrine 2.6