TranslatableMessageVisitor example

use Symfony\Component\Translation\MessageCatalogue;

final class PhpAstExtractorTest extends TestCase
{
    /** * @dataProvider resourcesProvider */
    public function testExtraction(iterable|string $resource)
    {
        $extractor = new PhpAstExtractor([
            new TransMethodVisitor(),
            new TranslatableMessageVisitor(),
            new ConstraintVisitor([
                'NotBlank',
                'Isbn',
                'Length',
            ]new TranslatableMessageVisitor()),
        ]);
        $extractor->setPrefix('prefix');
        $catalogue = new MessageCatalogue('en');

        $extractor->extract($resource$catalogue);

        
Home | Imprint | This part of the site doesn't use cookies.