diff --git a/AbstractType.php b/AbstractType.php index 262f86f1..3716eb1f 100644 --- a/AbstractType.php +++ b/AbstractType.php @@ -16,10 +16,6 @@ use Symfony\Component\Form\Util\StringUtil; use Symfony\Component\OptionsResolver\OptionsResolver; /** - * @template T - * - * @implements FormTypeInterface - * * @author Bernhard Schussek */ abstract class AbstractType implements FormTypeInterface @@ -33,24 +29,15 @@ abstract class AbstractType implements FormTypeInterface { } - /** - * @param FormBuilderInterface $builder - */ public function buildForm(FormBuilderInterface $builder, array $options): void { } - /** - * @param FormView $form - * @param FormInterface $view - */ public function buildView(FormView $view, FormInterface $form, array $options): void { } /** - * @param FormView $form - * @param FormInterface $view */ public function finishView(FormView $view, FormInterface $form, array $options): void { diff --git a/AbstractTypeExtension.php b/AbstractTypeExtension.php index acf1342f..b32f3b52 100644 --- a/AbstractTypeExtension.php +++ b/AbstractTypeExtension.php @@ -14,10 +14,6 @@ namespace Symfony\Component\Form; use Symfony\Component\OptionsResolver\OptionsResolver; /** - * @template T - * - * @implements FormTypeExtensionInterface - * * @author Bernhard Schussek */ abstract class AbstractTypeExtension implements FormTypeExtensionInterface @@ -26,25 +22,14 @@ abstract class AbstractTypeExtension implements FormTypeExtensionInterface { } - /** - * @param FormBuilderInterface $builder - */ public function buildForm(FormBuilderInterface $builder, array $options): void { } - /** - * @param FormView $form - * @param FormInterface $view - */ public function buildView(FormView $view, FormInterface $form, array $options): void { } - /** - * @param FormView $form - * @param FormInterface $view - */ public function finishView(FormView $view, FormInterface $form, array $options): void { } diff --git a/Event/PostSetDataEvent.php b/Event/PostSetDataEvent.php index a78cff09..5b6430a8 100644 --- a/Event/PostSetDataEvent.php +++ b/Event/PostSetDataEvent.php @@ -19,10 +19,6 @@ use Symfony\Component\Form\FormEvent; * * It can be used to modify a form depending on the populated data (adding or * removing fields dynamically). - * - * @template T - * - * @extends FormEvent */ final class PostSetDataEvent extends FormEvent { diff --git a/Event/PostSubmitEvent.php b/Event/PostSubmitEvent.php index 137cf23d..88cd5c4e 100644 --- a/Event/PostSubmitEvent.php +++ b/Event/PostSubmitEvent.php @@ -19,10 +19,6 @@ use Symfony\Component\Form\FormEvent; * once the model and view data have been denormalized. * * It can be used to fetch data after denormalization. - * - * @template T - * - * @extends FormEvent */ final class PostSubmitEvent extends FormEvent { diff --git a/Event/PreSetDataEvent.php b/Event/PreSetDataEvent.php index aedd7835..2644fda1 100644 --- a/Event/PreSetDataEvent.php +++ b/Event/PreSetDataEvent.php @@ -17,10 +17,6 @@ use Symfony\Component\Form\FormEvent; * This event is dispatched at the beginning of the Form::setData() method. * * It can be used to modify the data given during pre-population. - * - * @template T - * - * @extends FormEvent */ final class PreSetDataEvent extends FormEvent { diff --git a/Event/PreSubmitEvent.php b/Event/PreSubmitEvent.php index aa5856da..a72ac5d1 100644 --- a/Event/PreSubmitEvent.php +++ b/Event/PreSubmitEvent.php @@ -19,8 +19,6 @@ use Symfony\Component\Form\FormEvent; * It can be used to: * - Change data from the request, before submitting the data to the form. * - Add or remove form fields, before submitting the data to the form. - * - * @extends FormEvent> */ final class PreSubmitEvent extends FormEvent { diff --git a/Event/SubmitEvent.php b/Event/SubmitEvent.php index b49ebd7d..71d3b06d 100644 --- a/Event/SubmitEvent.php +++ b/Event/SubmitEvent.php @@ -18,10 +18,6 @@ use Symfony\Component\Form\FormEvent; * transforms back the normalized data to the model and view data. * * It can be used to change data from the normalized representation of the data. - * - * @template T - * - * @extends FormEvent */ final class SubmitEvent extends FormEvent { diff --git a/Form.php b/Form.php index dc85f52d..98ebfe19 100644 --- a/Form.php +++ b/Form.php @@ -68,10 +68,7 @@ use Symfony\Component\Validator\Constraints\Traverse; * @author Fabien Potencier * @author Bernhard Schussek * - * @template T - * * @implements \IteratorAggregate - * @implements FormInterface */ #[AssertForm] #[Traverse(false)] diff --git a/FormBuilderInterface.php b/FormBuilderInterface.php index 0510d01b..08d29303 100644 --- a/FormBuilderInterface.php +++ b/FormBuilderInterface.php @@ -14,9 +14,6 @@ namespace Symfony\Component\Form; /** * @author Bernhard Schussek * - * @template T - * - * @extends FormConfigBuilderInterface * @extends \Traversable */ interface FormBuilderInterface extends \Traversable, \Countable, FormConfigBuilderInterface @@ -35,9 +32,9 @@ interface FormBuilderInterface extends \Traversable, \Countable, FormConfigBuild /** * Creates a form builder. * - * @param string $name The name of the form or the name of the property - * @param class-string|null $type The type of the form or null if name is a property - * @param array $options + * @param string $name The name of the form or the name of the property + * @param string|null $type The type of the form or null if name is a property + * @param array $options */ public function create(string $name, ?string $type = null, array $options = []): self; @@ -67,8 +64,6 @@ interface FormBuilderInterface extends \Traversable, \Countable, FormConfigBuild /** * Creates the form. - * - * @return FormInterface */ public function getForm(): FormInterface; } diff --git a/FormConfigBuilderInterface.php b/FormConfigBuilderInterface.php index d8679ab2..6b22b9f9 100644 --- a/FormConfigBuilderInterface.php +++ b/FormConfigBuilderInterface.php @@ -13,17 +13,8 @@ namespace Symfony\Component\Form; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\PropertyAccess\PropertyPathInterface; -use Symfony\Component\Form\Event\PreSetDataEvent; -use Symfony\Component\Form\Event\PreSubmitEvent; -use Symfony\Component\Form\Event\PostSetDataEvent; -use Symfony\Component\Form\Event\SubmitEvent; -use Symfony\Component\Form\Event\PostSubmitEvent; /** - * @template T - * - * @extends FormConfigInterface - * * @author Bernhard Schussek */ interface FormConfigBuilderInterface extends FormConfigInterface @@ -31,8 +22,6 @@ interface FormConfigBuilderInterface extends FormConfigInterface /** * Adds an event listener to an event on this form. * - * @param FormEvents::* $eventName - * @param (callable(PreSetDataEvent): void)|(callable(PostSetDataEvent): void)|(callable(PreSubmitEvent): void)|(callable(SubmitEvent): void)|(callable(PostSubmitEvent): void) $listener * @param int $priority The priority of the listener. Listeners * with a higher priority are called before * listeners with a lower priority. @@ -258,8 +247,6 @@ interface FormConfigBuilderInterface extends FormConfigInterface /** * Builds and returns the form configuration. - * - * @return FormConfigInterface */ public function getFormConfig(): FormConfigInterface; diff --git a/FormConfigInterface.php b/FormConfigInterface.php index a1a03520..93d1998e 100644 --- a/FormConfigInterface.php +++ b/FormConfigInterface.php @@ -17,8 +17,6 @@ use Symfony\Component\PropertyAccess\PropertyPathInterface; /** * The configuration of a {@link Form} object. * - * @template T - * * @author Bernhard Schussek */ interface FormConfigInterface @@ -132,8 +130,6 @@ interface FormConfigInterface /** * Returns the initial data of the form. - * - * @return T|null */ public function getData(): mixed; diff --git a/FormEvent.php b/FormEvent.php index 0f3149f4..e6a3878f 100644 --- a/FormEvent.php +++ b/FormEvent.php @@ -14,16 +14,10 @@ namespace Symfony\Component\Form; use Symfony\Contracts\EventDispatcher\Event; /** - * @template T - * * @author Bernhard Schussek */ class FormEvent extends Event { - /** - * @param FormInterface $form The form at the source of the event - * @param T $data The data associated with this event - */ public function __construct( private FormInterface $form, protected mixed $data, @@ -32,8 +26,6 @@ class FormEvent extends Event /** * Returns the form at the source of the event. - * - * @return FormInterface */ public function getForm(): FormInterface { @@ -42,8 +34,6 @@ class FormEvent extends Event /** * Returns the data associated with this event. - * - * @return T */ public function getData(): mixed { @@ -52,8 +42,6 @@ class FormEvent extends Event /** * Allows updating with some filtered data. - * - * @param T $data The data associated with this event */ public function setData(mixed $data): void { diff --git a/FormFactoryInterface.php b/FormFactoryInterface.php index 89a732f9..0f311c0e 100644 --- a/FormFactoryInterface.php +++ b/FormFactoryInterface.php @@ -26,12 +26,7 @@ interface FormFactoryInterface * * @see createBuilder() * - * @template T - * - * @param class-string> $type - * @param T|null $data The initial data - * - * @return FormInterface + * @param mixed $data The initial data * * @throws InvalidOptionsException if any given option is not applicable to the given type */ @@ -42,12 +37,7 @@ interface FormFactoryInterface * * @see createNamedBuilder() * - * @template T - * - * @param class-string> $type - * @param T|null $data The initial data - * - * @return FormInterface + * @param mixed $data The initial data * * @throws InvalidOptionsException if any given option is not applicable to the given type */ @@ -69,12 +59,7 @@ interface FormFactoryInterface /** * Returns a form builder. * - * @template T - * - * @param class-string> $type - * @param T|null $data The initial data - * - * @return FormBuilderInterface + * @param mixed $data The initial data * * @throws InvalidOptionsException if any given option is not applicable to the given type */ @@ -83,12 +68,7 @@ interface FormFactoryInterface /** * Returns a form builder. * - * @template T - * - * @param class-string> $type - * @param T|null $data The initial data - * - * @return FormBuilderInterface + * @param mixed $data The initial data * * @throws InvalidOptionsException if any given option is not applicable to the given type */ diff --git a/FormInterface.php b/FormInterface.php index 8c1db609..23392c49 100644 --- a/FormInterface.php +++ b/FormInterface.php @@ -18,8 +18,6 @@ use Symfony\Component\PropertyAccess\PropertyPathInterface; * * @author Bernhard Schussek * - * @template T - * * @extends \ArrayAccess * @extends \Traversable */ @@ -114,9 +112,9 @@ interface FormInterface extends \ArrayAccess, \Traversable, \Countable /** * Returns the model data in the format needed for the underlying object. * - * @return T|null When the field is not submitted, the default data is returned. - * When the field is submitted, the default data has been bound - * to the submitted view data. + * @return mixed When the field is not submitted, the default data is returned. + * When the field is submitted, the default data has been bound + * to the submitted view data. * * @throws Exception\RuntimeException If the form inherits data but has no parent */ @@ -287,8 +285,5 @@ interface FormInterface extends \ArrayAccess, \Traversable, \Countable */ public function isRoot(): bool; - /** - * @return FormView - */ public function createView(?FormView $parent = null): FormView; } diff --git a/FormTypeExtensionInterface.php b/FormTypeExtensionInterface.php index d935c897..838406d2 100644 --- a/FormTypeExtensionInterface.php +++ b/FormTypeExtensionInterface.php @@ -14,8 +14,6 @@ namespace Symfony\Component\Form; use Symfony\Component\OptionsResolver\OptionsResolver; /** - * @template T - * * @author Bernhard Schussek */ interface FormTypeExtensionInterface @@ -35,8 +33,7 @@ interface FormTypeExtensionInterface * This method is called after the extended type has built the form to * further modify it. * - * @param FormBuilderInterface $builder - * @param array $options + * @param array $options * * @see FormTypeInterface::buildForm() */ @@ -48,8 +45,6 @@ interface FormTypeExtensionInterface * This method is called after the extended type has built the view to * further modify it. * - * @param FormView $view - * @param FormInterface $form * @param array $options * * @see FormTypeInterface::buildView() @@ -62,8 +57,6 @@ interface FormTypeExtensionInterface * This method is called after the extended type has finished the view to * further modify it. * - * @param FormView $view - * @param FormInterface $form * @param array $options * * @see FormTypeInterface::finishView() diff --git a/FormTypeInterface.php b/FormTypeInterface.php index 590a0715..6a27b59b 100644 --- a/FormTypeInterface.php +++ b/FormTypeInterface.php @@ -15,8 +15,6 @@ use Symfony\Component\OptionsResolver\OptionsResolver; /** * @author Bernhard Schussek - * - * @template T */ interface FormTypeInterface { @@ -39,8 +37,7 @@ interface FormTypeInterface * This method is called for each type in the hierarchy starting from the * top most type. Type extensions can further modify the form. * - * @param FormBuilderInterface $builder - * @param array $options + * @param array $options * * @see FormTypeExtensionInterface::buildForm() */ @@ -56,9 +53,7 @@ interface FormTypeInterface * This means that you cannot access child views in this method. If you need * to do so, move your logic to {@link finishView()} instead. * - * @param FormView $form - * @param FormInterface $view - * @param array $options + * @param array $options * * @see FormTypeExtensionInterface::buildView() */ @@ -75,9 +70,7 @@ interface FormTypeInterface * such logic in this method that actually accesses child views. For everything * else you are recommended to implement {@link buildView()} instead. * - * @param FormView $form - * @param FormInterface $view - * @param array $options + * @param array $options * * @see FormTypeExtensionInterface::finishView() */ diff --git a/FormView.php b/FormView.php index 2dedf9fc..93804bb8 100644 --- a/FormView.php +++ b/FormView.php @@ -16,8 +16,6 @@ use Symfony\Component\Form\Exception\BadMethodCallException; /** * @author Bernhard Schussek * - * @template T - * * @implements \ArrayAccess * @implements \IteratorAggregate */ @@ -25,8 +23,6 @@ class FormView implements \ArrayAccess, \IteratorAggregate, \Countable { /** * The variables assigned to this view. - * - * @var array{value: T|null, attr: array, ...} */ public array $vars = [ 'value' => null,