mirror of
https://github.com/Respect/Validation.git
synced 2026-03-16 23:35:45 +01:00
Both `ArrayFormatter` and `StringFormatter` accept an instance of the `Translator`. Thinking about it a bit better, I realised that a formatter might not always need a `Translator`, but it will surely need a `Renderer`. Besides, the `InterpolationRenderer` needs to take translation into account, so it seems more natural to me that this is the one that will get an instance of the `Translator`, as other implementations of the `Renderer` might not even deal with translations.
22 lines
429 B
PHP
22 lines
429 B
PHP
<?php
|
|
|
|
/*
|
|
* Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Respect\Validation\Message;
|
|
|
|
use Respect\Validation\Result;
|
|
|
|
interface ArrayFormatter
|
|
{
|
|
/**
|
|
* @param array<string, mixed> $templates
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function format(Result $result, Renderer $renderer, array $templates): array;
|
|
}
|