Кто-то пытался зарегать дополнительные функции для языка выражений в аннотациях\аттрибутах? 
Хочу валидировать поля классов через аттрибуты, соответственно надо хотя бы count для массивов иметь. Но нашел всего один вопрос по древней 2.7 симфе и тот не решен.
Официальная дока не помогла. Никакие функции не регаются.
The function "count" does not exist around position 30 for expression `this.filterType == 'users' and count(value) == 0`.
#[Assert\Expression(
        "this.userType == 'users' and count(value) == 0",
        message: 'If filterType is "users", the array "users" should not be empty or null!',
    )]
    public array $users;
<?php
namespace App\Infrastructure\ExpressionLanguage;
use App\Infrastructure\ExpressionLanguage\Provider\ArrayCountExpressionLanguageProvider;
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage as BaseExpressionLanguage;
class ExpressionLanguage extends BaseExpressionLanguage
{
    public function __construct(CacheItemPoolInterface $cache = null, array $providers = [])
    {
        array_unshift($providers, new ArrayCountExpressionLanguageProvider());
        parent::__construct($cache, $providers);
    }
}
в провайдере
<?php
namespace App\Infrastructure\ExpressionLanguage\Provider;
use Symfony\Component\ExpressionLanguage\ExpressionFunction;
use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface;
class ArrayCountExpressionLanguageProvider implements ExpressionFunctionProviderInterface
{
    public function getFunctions()
    {
        return ExpressionFunction::fromPhp('count');
    }
}