| Conditions | 1 |
| Paths | 1 |
| Total Lines | 72 |
| Code Lines | 50 |
| 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 |
||
| 97 | public function getDoctrineConfig() |
||
| 98 | { |
||
| 99 | return [ |
||
| 100 | 'cache' => [ |
||
| 101 | 'apcu' => [ |
||
| 102 | 'class' => Cache\ApcuCache::class, |
||
| 103 | 'namespace' => __NAMESPACE__, |
||
| 104 | ], |
||
| 105 | 'array' => [ |
||
| 106 | 'class' => Cache\ArrayCache::class, |
||
| 107 | 'namespace' => __NAMESPACE__, |
||
| 108 | ], |
||
| 109 | 'filesystem' => [ |
||
| 110 | 'class' => Cache\FilesystemCache::class, |
||
| 111 | 'directory' => 'data/DoctrineModule/cache', |
||
| 112 | 'namespace' => __NAMESPACE__, |
||
| 113 | ], |
||
| 114 | 'memcache' => [ |
||
| 115 | 'class' => Cache\MemcacheCache::class, |
||
| 116 | 'instance' => 'my_memcache_alias', |
||
| 117 | 'namespace' => __NAMESPACE__, |
||
| 118 | ], |
||
| 119 | 'memcached' => [ |
||
| 120 | 'class' => Cache\MemcachedCache::class, |
||
| 121 | 'instance' => 'my_memcached_alias', |
||
| 122 | 'namespace' => __NAMESPACE__, |
||
| 123 | ], |
||
| 124 | 'predis' => [ |
||
| 125 | 'class' => Cache\PredisCache::class, |
||
| 126 | 'instance' => 'my_predis_alias', |
||
| 127 | 'namespace' => __NAMESPACE__, |
||
| 128 | ], |
||
| 129 | 'redis' => [ |
||
| 130 | 'class' => Cache\RedisCache::class, |
||
| 131 | 'instance' => 'my_redis_alias', |
||
| 132 | 'namespace' => __NAMESPACE__, |
||
| 133 | ], |
||
| 134 | 'wincache' => [ |
||
| 135 | 'class' => Cache\WinCacheCache::class, |
||
| 136 | 'namespace' => __NAMESPACE__, |
||
| 137 | ], |
||
| 138 | 'xcache' => [ |
||
| 139 | 'class' => Cache\XcacheCache::class, |
||
| 140 | 'namespace' => __NAMESPACE__, |
||
| 141 | ], |
||
| 142 | 'zenddata' => [ |
||
| 143 | 'class' => Cache\ZendDataCache::class, |
||
| 144 | 'namespace' => __NAMESPACE__, |
||
| 145 | ], |
||
| 146 | ], |
||
| 147 | |||
| 148 | // These authentication settings are a hack to tide things over until version 1.0 |
||
| 149 | // Normal doctrineModule should have no mention of odm or orm |
||
| 150 | 'authentication' => [ |
||
| 151 | // default authentication options should be set in either the odm or orm modules |
||
| 152 | 'odm_default' => [], |
||
| 153 | 'orm_default' => [], |
||
| 154 | ], |
||
| 155 | 'authenticationadapter' => [ |
||
| 156 | 'odm_default' => true, |
||
| 157 | 'orm_default' => true, |
||
| 158 | ], |
||
| 159 | 'authenticationstorage' => [ |
||
| 160 | 'odm_default' => true, |
||
| 161 | 'orm_default' => true, |
||
| 162 | ], |
||
| 163 | 'authenticationservice' => [ |
||
| 164 | 'odm_default' => true, |
||
| 165 | 'orm_default' => true, |
||
| 166 | ], |
||
| 167 | ]; |
||
| 168 | } |
||
| 169 | |||
| 197 |