| Conditions | 1 | 
| Paths | 1 | 
| Total Lines | 52 | 
| Code Lines | 37 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php  | 
            ||
| 95 | protected function configureFormFields(FormMapper $formMapper)  | 
            ||
| 96 |     { | 
            ||
| 97 | $formMapper  | 
            ||
| 98 |             ->with('form.group_general') | 
            ||
| 99 |             ->add('name', 'Symfony\Component\Form\Extension\Core\Type\TextType') | 
            ||
| 100 |             ->add('title', 'Symfony\Component\Form\Extension\Core\Type\TextType') | 
            ||
| 101 | ->add(  | 
            ||
| 102 | 'children',  | 
            ||
| 103 | 'Sonata\CoreBundle\Form\Type\CollectionType',  | 
            ||
| 104 | ['label' => false, 'type_options' => [  | 
            ||
| 105 | 'delete' => true,  | 
            ||
| 106 | 'delete_options' => [  | 
            ||
| 107 | 'type' => 'Symfony\Component\Form\Extension\Core\Type\CheckboxType',  | 
            ||
| 108 | 'type_options' => ['required' => false, 'mapped' => false],  | 
            ||
| 109 | ], ],  | 
            ||
| 110 | ],  | 
            ||
| 111 | ['edit' => 'inline', 'inline' => 'table', 'admin_code' => 'sonata_admin_doctrine_phpcr.test.admin']  | 
            ||
| 112 | )  | 
            ||
| 113 | ->add(  | 
            ||
| 114 | 'routes',  | 
            ||
| 115 | 'Sonata\AdminBundle\Form\Type\ModelType',  | 
            ||
| 116 | ['property' => 'title', 'multiple' => true, 'expanded' => false]  | 
            ||
| 117 | )  | 
            ||
| 118 |             ->add('parentDocument', 'Symfony\Cmf\Bundle\TreeBrowserBundle\Form\Type\TreeSelectType', [ | 
            ||
| 119 | 'widget' => 'browser',  | 
            ||
| 120 | 'root_node' => $this->getRootPath(),  | 
            ||
| 121 | ])  | 
            ||
| 122 | ->add(  | 
            ||
| 123 | 'child',  | 
            ||
| 124 | 'Sonata\AdminBundle\Form\Type\ModelType',  | 
            ||
| 125 | [  | 
            ||
| 126 | 'property' => 'title',  | 
            ||
| 127 | 'class' => 'Sonata\DoctrinePHPCRAdminBundle\Tests\Fixtures\App\Document\Content',  | 
            ||
| 128 | 'btn_catalogue' => 'List',  | 
            ||
| 129 | 'required' => false,  | 
            ||
| 130 | ],  | 
            ||
| 131 | ['admin_code' => 'sonata_admin_doctrine_phpcr.test.admin']  | 
            ||
| 132 | )  | 
            ||
| 133 |             ->add('singleRoute', 'Symfony\Cmf\Bundle\TreeBrowserBundle\Form\Type\TreeSelectType', [ | 
            ||
| 134 | 'widget' => 'browser',  | 
            ||
| 135 | 'root_node' => $this->getRootPath(),  | 
            ||
| 136 | ])  | 
            ||
| 137 | ->end();  | 
            ||
| 138 | |||
| 139 |         $formMapper->getFormBuilder()->get('parentDocument')->addModelTransformer(new DocumentToPathTransformer( | 
            ||
| 140 | $this->managerRegistry->getManagerForClass($this->getClass())  | 
            ||
| 141 | ));  | 
            ||
| 142 | |||
| 143 |         $formMapper->getFormBuilder()->get('singleRoute')->addModelTransformer(new DocumentToPathTransformer( | 
            ||
| 144 | $this->managerRegistry->getManagerForClass($this->getClass())  | 
            ||
| 145 | ));  | 
            ||
| 146 | }  | 
            ||
| 147 | |||
| 155 |