| Conditions | 1 |
| Paths | 1 |
| Total Lines | 51 |
| Code Lines | 36 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| 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 |
||
| 31 | public function build(ContainerBuilder $container) |
||
| 32 | { |
||
| 33 | $this->checkDependentBundlesAreEnable($container); |
||
| 34 | |||
| 35 | $container->addCompilerPass(new ClassMapTemplateFactoryPass(), PassConfig::TYPE_OPTIMIZE); |
||
| 36 | $container->addCompilerPass(new DoctrineORMCustomTypesPass(), PassConfig::TYPE_OPTIMIZE); |
||
| 37 | $container->addCompilerPass(new RegisterBusesPass(), PassConfig::TYPE_OPTIMIZE); |
||
| 38 | |||
| 39 | $container->loadFromExtension('doctrine', [ |
||
| 40 | 'orm' => [ |
||
| 41 | 'mappings' => [ |
||
| 42 | 'Lin3sCmsKernelMenu' => [ |
||
| 43 | 'type' => 'xml', |
||
| 44 | 'is_bundle' => false, |
||
| 45 | 'dir' => $this->doctrineORMBasePath() . '/Menu/Mapping/', |
||
| 46 | 'prefix' => 'LIN3S\CMSKernel\Domain\Model\Menu', |
||
| 47 | ], |
||
| 48 | 'Lin3sCmsKernelPage' => [ |
||
| 49 | 'type' => 'xml', |
||
| 50 | 'is_bundle' => false, |
||
| 51 | 'dir' => $this->doctrineORMBasePath() . '/Page/Mapping/', |
||
| 52 | 'prefix' => 'LIN3S\CMSKernel\Domain\Model\Page', |
||
| 53 | ], |
||
| 54 | 'Lin3sCmsKernelSeo' => [ |
||
| 55 | 'type' => 'xml', |
||
| 56 | 'is_bundle' => false, |
||
| 57 | 'dir' => $this->doctrineORMBasePath() . '/Seo/Mapping/', |
||
| 58 | 'prefix' => 'LIN3S\CMSKernel\Domain\Model\Seo', |
||
| 59 | ], |
||
| 60 | 'Lin3sCmsKernelTranslation' => [ |
||
| 61 | 'type' => 'xml', |
||
| 62 | 'is_bundle' => false, |
||
| 63 | 'dir' => $this->doctrineORMBasePath() . '/Translation/Mapping/', |
||
| 64 | 'prefix' => 'LIN3S\CMSKernel\Domain\Model\Translation', |
||
| 65 | ], |
||
| 66 | ], |
||
| 67 | ], |
||
| 68 | ]); |
||
| 69 | |||
| 70 | $container->loadFromExtension('twig', [ |
||
| 71 | 'paths' => [ |
||
| 72 | $this->twigBasePath(), |
||
| 73 | ], |
||
| 74 | 'form_themes' => [ |
||
| 75 | 'Form/file.html.twig', |
||
| 76 | 'Form/template_selector.html.twig', |
||
| 77 | 'Form/wysiwyg.html.twig', |
||
| 78 | 'Form/menu_tree.html.twig', |
||
| 79 | ], |
||
| 80 | ]); |
||
| 81 | } |
||
| 82 | |||
| 114 |