Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip Symfony data_class in forms #62

Merged
merged 4 commits into from
Jun 19, 2023
Merged

Conversation

TomasVotruba
Copy link
Owner

@TomasVotruba TomasVotruba commented Jun 19, 2023

Classes, that are used in "data_class" elements should be skipped, because they use Symfony magic form getters/setters

<?php

declare(strict_types=1);

namespace TomasVotruba\UnusedPublic\Tests\Rules\UnusedPublicClassMethodRule\Fixture\Symfony;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolver;

final class SomeFormType extends AbstractType
{
    public function configureOptions(OptionsResolver $optionsResolver): void
    {
        $optionsResolver->setDefaults([
            'data_class' => SkipEntityGetterSetters::class,
        ]);
    }
}

@TomasVotruba TomasVotruba changed the title bump deps Bump dependencies Jun 19, 2023
@TomasVotruba TomasVotruba changed the title Bump dependencies Skip Symfony form class Jun 19, 2023
@TomasVotruba TomasVotruba changed the title Skip Symfony form class Skip Symfony data_class in forms Jun 19, 2023
@TomasVotruba TomasVotruba merged commit a76c093 into main Jun 19, 2023
@TomasVotruba TomasVotruba deleted the tv-skip-form-data-class branch June 19, 2023 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant