The result of `$config->getOption('type')` could also be an instance of [FormTypeInterface](http://api.symfony.com/2.2/Symfony/Component/Form/FormTypeInterface.html). In that case, you could get the type name from the getName method of that instance.

This would fix this issue when you define the collection field as follows:

```php
$builder->add('items', 'collection', array('type' => new CustomFormType()));
```