for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace BrenoRoosevelt\Validation\Translation;
/** @internal */
class CallableTranslator implements TranslatorInterface
{
/** @var callable */
private $callback;
public function __construct(callable $translator)
$this->callback = $translator;
}
public function translate(string $message, ...$args): ?string
return call_user_func_array($this->callback, [$message, ...$args]);