| Conditions | 10 |
| Paths | 128 |
| Total Lines | 18 |
| Code Lines | 11 |
| 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 |
||
| 26 | public function _initialize(): void |
||
| 27 | { |
||
| 28 | $rootDir = realpath(__DIR__ . '/../../../../../../'); |
||
| 29 | $applicationEnv = $this->getApplicationEnv(); |
||
| 30 | |||
| 31 | defined('APPLICATION_ENV') || define('APPLICATION_ENV', $applicationEnv); |
||
| 32 | |||
| 33 | defined('APPLICATION_STORE') || define('APPLICATION_STORE', (isset($_SERVER['APPLICATION_STORE']) && $_SERVER['APPLICATION_STORE'] !== '') ? $_SERVER['APPLICATION_STORE'] : 'DE'); // phpcs:ignore SlevomatCodingStandard.Variables.DisallowSuperGlobalVariable |
||
| 34 | putenv('APPLICATION_STORE=' . APPLICATION_STORE); |
||
| 35 | |||
| 36 | defined('APPLICATION') || define('APPLICATION', ''); |
||
| 37 | |||
| 38 | defined('APPLICATION_ROOT_DIR') || define('APPLICATION_ROOT_DIR', $rootDir); |
||
| 39 | defined('APPLICATION_SOURCE_DIR') || define('APPLICATION_SOURCE_DIR', APPLICATION_ROOT_DIR . '/src'); |
||
| 40 | defined('APPLICATION_VENDOR_DIR') || define('APPLICATION_VENDOR_DIR', APPLICATION_ROOT_DIR . '/vendor'); |
||
| 41 | |||
| 42 | defined('APPLICATION_CODE_BUCKET') || define('APPLICATION_CODE_BUCKET', $this->createCodeBucketConfig()->getCurrentCodeBucket()); |
||
| 43 | putenv('APPLICATION_CODE_BUCKET=' . APPLICATION_CODE_BUCKET); |
||
| 44 | } |
||
| 66 |