| Conditions | 2 |
| Paths | 2 |
| Total Lines | 127 |
| Code Lines | 61 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 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 |
||
| 29 | public function registerBundles() |
||
| 30 | { |
||
| 31 | $bundles = array( |
||
| 32 | new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), |
||
| 33 | new Symfony\Bundle\SecurityBundle\SecurityBundle(), |
||
| 34 | new Symfony\Bundle\TwigBundle\TwigBundle(), |
||
| 35 | new Symfony\Bundle\MonologBundle\MonologBundle(), |
||
| 36 | new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), |
||
| 37 | new Symfony\Bundle\AsseticBundle\AsseticBundle(), |
||
| 38 | new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), |
||
| 39 | |||
| 40 | new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), |
||
| 41 | new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(), |
||
| 42 | //new Doctrine\Bundle\PHPCRBundle\DoctrinePHPCRBundle(), |
||
| 43 | new Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(), |
||
| 44 | |||
| 45 | new FOS\RestBundle\FOSRestBundle(), |
||
| 46 | new JMS\SerializerBundle\JMSSerializerBundle($this), |
||
| 47 | |||
| 48 | // KNP HELPER BUNDLES |
||
| 49 | new Knp\Bundle\MenuBundle\KnpMenuBundle(), |
||
| 50 | new Knp\Bundle\MarkdownBundle\KnpMarkdownBundle(), |
||
| 51 | // Data grid |
||
| 52 | //new APY\DataGridBundle\APYDataGridBundle(), |
||
| 53 | new Chamilo\FaqBundle\ChamiloFaqBundle(), |
||
| 54 | new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(), |
||
| 55 | new A2lix\TranslationFormBundle\A2lixTranslationFormBundle(), |
||
| 56 | |||
| 57 | // Sonata |
||
| 58 | new Sonata\EasyExtendsBundle\SonataEasyExtendsBundle(), |
||
| 59 | new Sonata\CoreBundle\SonataCoreBundle(), |
||
| 60 | new Sonata\IntlBundle\SonataIntlBundle(), |
||
| 61 | new Sonata\FormatterBundle\SonataFormatterBundle(), |
||
| 62 | new Sonata\CacheBundle\SonataCacheBundle(), |
||
| 63 | new Sonata\BlockBundle\SonataBlockBundle(), |
||
| 64 | new Sonata\SeoBundle\SonataSeoBundle(), |
||
| 65 | new Sonata\ClassificationBundle\SonataClassificationBundle(), |
||
| 66 | new Sonata\NotificationBundle\SonataNotificationBundle(), |
||
| 67 | new Sonata\DatagridBundle\SonataDatagridBundle(), |
||
| 68 | new Sonata\MediaBundle\SonataMediaBundle(), |
||
| 69 | new Sonata\PageBundle\SonataPageBundle(), |
||
| 70 | new Theodo\Evolution\Bundle\SessionBundle\TheodoEvolutionSessionBundle(), |
||
| 71 | |||
| 72 | new Spy\TimelineBundle\SpyTimelineBundle(), |
||
| 73 | new Sonata\TimelineBundle\SonataTimelineBundle(), |
||
| 74 | |||
| 75 | //new SimpleThings\EntityAudit\SimpleThingsEntityAuditBundle(), |
||
| 76 | |||
| 77 | new Sonata\AdminBundle\SonataAdminBundle(), |
||
| 78 | new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(), |
||
| 79 | |||
| 80 | |||
| 81 | // CMF Integration |
||
| 82 | new Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle(), |
||
| 83 | //new Symfony\Cmf\Bundle\SearchBundle\CmfSearchBundle(), |
||
| 84 | //new Symfony\Cmf\Bundle\BlogBundle\CmfBlogBundle(), |
||
| 85 | //new Sonata\DoctrinePHPCRAdminBundle\SonataDoctrinePHPCRAdminBundle(), |
||
| 86 | |||
| 87 | // Oauth |
||
| 88 | //new HWI\Bundle\OAuthBundle\HWIOAuthBundle(), |
||
| 89 | |||
| 90 | //new Gregwar\CaptchaBundle\GregwarCaptchaBundle(), |
||
| 91 | new Mopa\Bundle\BootstrapBundle\MopaBootstrapBundle(), |
||
| 92 | //new Liip\ThemeBundle\LiipThemeBundle(), |
||
| 93 | new Ivory\CKEditorBundle\IvoryCKEditorBundle(), |
||
| 94 | new FM\ElfinderBundle\FMElfinderBundle(), |
||
| 95 | new FOS\JsRoutingBundle\FOSJsRoutingBundle(), |
||
| 96 | new Knp\DoctrineBehaviors\Bundle\DoctrineBehaviorsBundle(), |
||
| 97 | |||
| 98 | // User |
||
| 99 | new FOS\UserBundle\FOSUserBundle(), |
||
| 100 | new Sonata\UserBundle\SonataUserBundle('FOSUserBundle'), |
||
| 101 | new Chamilo\UserBundle\ChamiloUserBundle(), |
||
| 102 | /* |
||
| 103 | // Sylius |
||
| 104 | /*new Sylius\Bundle\SettingsBundle\SyliusSettingsBundle(), |
||
| 105 | //new Sylius\Bundle\AttributeBundle\SyliusAttributeBundle(), |
||
| 106 | new Sylius\Bundle\ResourceBundle\SyliusResourceBundle(), |
||
| 107 | new Sylius\Bundle\FlowBundle\SyliusFlowBundle(), |
||
| 108 | new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(), |
||
| 109 | new Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle(),*/ |
||
| 110 | |||
| 111 | // Chamilo |
||
| 112 | //new Chamilo\InstallerBundle\ChamiloInstallerBundle(), |
||
| 113 | new Chamilo\CoreBundle\ChamiloCoreBundle(), |
||
| 114 | new Chamilo\CourseBundle\ChamiloCourseBundle(), |
||
| 115 | // new Chamilo\SettingsBundle\ChamiloSettingsBundle(), |
||
| 116 | new Chamilo\ThemeBundle\ChamiloThemeBundle(), |
||
| 117 | //new Chamilo\NotificationBundle\ChamiloNotificationBundle(), |
||
| 118 | new Chamilo\AdminBundle\ChamiloAdminBundle(), |
||
| 119 | new Chamilo\TimelineBundle\ChamiloTimelineBundle(), |
||
| 120 | new \Chamilo\ContactBundle\ChamiloContactBundle(), |
||
| 121 | |||
| 122 | // Based in Sonata |
||
| 123 | new Chamilo\ClassificationBundle\ChamiloClassificationBundle(), |
||
| 124 | new Chamilo\MediaBundle\ChamiloMediaBundle(), |
||
| 125 | new Chamilo\PageBundle\ChamiloPageBundle(), |
||
| 126 | /* |
||
| 127 | // Chamilo course tool |
||
| 128 | //new Chamilo\NotebookBundle\ChamiloNotebookBundle(), |
||
| 129 | |||
| 130 | // Data |
||
| 131 | //new Oneup\FlysystemBundle\OneupFlysystemBundle(), */ |
||
| 132 | |||
| 133 | // Extra |
||
| 134 | new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), |
||
| 135 | |||
| 136 | /* |
||
| 137 | //new JMS\TranslationBundle\JMSTranslationBundle(), |
||
| 138 | //new JMS\DiExtraBundle\JMSDiExtraBundle($this), |
||
| 139 | //new JMS\AopBundle\JMSAopBundle(), |
||
| 140 | /*new Bazinga\Bundle\FakerBundle\BazingaFakerBundle(), |
||
| 141 | //new Chamilo\CmsBundle\ChamiloCmsBundle(), |
||
| 142 | */ |
||
| 143 | new Lunetics\LocaleBundle\LuneticsLocaleBundle() |
||
| 144 | ); |
||
| 145 | |||
| 146 | if (in_array($this->getEnvironment(), array('dev', 'test'))) { |
||
| 147 | //$bundles[] = new Jjanvier\Bundle\CrowdinBundle\JjanvierCrowdinBundle(); |
||
| 148 | $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); |
||
| 149 | $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); |
||
| 150 | $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); |
||
| 151 | $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); |
||
| 152 | //$bundles[] = new Sp\BowerBundle\SpBowerBundle(); |
||
| 153 | } |
||
| 154 | |||
| 155 | return $bundles; |
||
| 156 | } |
||
| 231 |