Skip to content

[Form] Possible bug in \Symfony\Component\Form\ResolvedFormType #14919

Closed
@c1tru55

Description

@c1tru55

When I try to call ResolvedFormType::getTypeExtensions() I get an error:

Attempted to call method "getExtensions" on class "Symfony\Component\Form\Extension\Core\Type\FormType".

As I see there are code for BC ( https://github.com/symfony/Form/blob/master/ResolvedFormType.php#L98 ):

    public function getTypeExtensions()
    {
        // BC
        if ($this->innerType instanceof AbstractType) {
            return $this->innerType->getExtensions();
        }

        return $this->typeExtensions;
    }

but we don't have use statement for deprecated AbstractType:

use Symfony\Component\Form\Exception\InvalidArgumentException;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\OptionsResolver\OptionsResolver;

so it is assumed that deprecated AbstractType class is stored in the same folder as ResolvedFormType class. But current AbstractType is also stored in the same folder with ResolvedFormType and it doesn't have getExtensions() method: https://github.com/symfony/Form/blob/master/AbstractType.php

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions