Cannot read index "type" from object of type "stdClass" because it doesn’t implement ArrayAccess

  guzzle6, php, symfony, symfony-forms, twig

I am getting this error on this

    if ($this->container->getParameter('') === true)
        $builder->add('familyMembers', CollectionType::class, array(
            'type' => new FamilyMember(),
            'allow_add' => TRUE,
            'allow_delete' => TRUE,
            'by_reference' => FALSE,


this is the form Type

class FamilyMember extends AbstractType
    public function buildForm(FormBuilderInterface $builder, array $options) {
            ->add('type', ChoiceType::class, array(
                'label'     => ' ',
                'required'  => FALSE,
                'choices'   => array(
                    'SP'    => 'account.address.option.type.SP',
                    'DP'    => 'account.address.option.type.DP',
                'expanded'  => TRUE,
                'multiple'  => FALSE,
                'placeholder' => FALSE,

what I am trying to do is allow the form to be created if they meet that condition.

this worked but i updated to symfony2.8 and I also went from guzzle3 to guzzle 6 (doubt is this one)

Source: Symfony Questions