Conditions | 5 |
Paths | 5 |
Total Lines | 17 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
1 | <?php |
||
37 | public static function setupHome($home) |
||
38 | { |
||
39 | if (empty($home)) { |
||
40 | throw new \InvalidArgumentException('Empty home directory encountered.'); |
||
41 | } |
||
42 | |||
43 | // FIXME: check that this really works correctly in CLI mode, maybe the chdir is already enough? |
||
44 | if (false === getenv('COMPOSER')) { |
||
45 | putenv('COMPOSER=' . $home . DIRECTORY_SEPARATOR . 'composer.json'); |
||
46 | } |
||
47 | chdir($home); |
||
48 | |||
49 | // Ensure at least one of the environment variables is available. |
||
50 | if (!getenv('COMPOSER_HOME') && !getenv('HOME')) { |
||
51 | putenv('COMPOSER_HOME=' . $home); |
||
52 | } |
||
53 | } |
||
54 | } |
||
55 |
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.