Conditions | 10 |
Paths | 128 |
Total Lines | 17 |
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 | defined('APPLICATION_STORE') || define('APPLICATION_STORE', (isset($_SERVER['APPLICATION_STORE']) && $_SERVER['APPLICATION_STORE'] !== '') ? $_SERVER['APPLICATION_STORE'] : 'DE'); // phpcs:ignore SlevomatCodingStandard.Variables.DisallowSuperGlobalVariable |
||
33 | putenv('APPLICATION_STORE=' . APPLICATION_STORE); |
||
34 | |||
35 | defined('APPLICATION') || define('APPLICATION', ''); |
||
36 | |||
37 | defined('APPLICATION_ROOT_DIR') || define('APPLICATION_ROOT_DIR', $rootDir); |
||
38 | defined('APPLICATION_SOURCE_DIR') || define('APPLICATION_SOURCE_DIR', APPLICATION_ROOT_DIR . '/src'); |
||
39 | defined('APPLICATION_VENDOR_DIR') || define('APPLICATION_VENDOR_DIR', APPLICATION_ROOT_DIR . '/vendor'); |
||
40 | |||
41 | defined('APPLICATION_CODE_BUCKET') || define('APPLICATION_CODE_BUCKET', $this->createCodeBucketConfig()->getCurrentCodeBucket()); |
||
42 | putenv('APPLICATION_CODE_BUCKET=' . APPLICATION_CODE_BUCKET); |
||
43 | } |
||
65 |