| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 2 | public static function createStrategy( |
|
| 21 | string $serverHeaderToSearch, |
||
| 22 | string $cliArgToSearch, |
||
| 23 | string $envFileName, |
||
| 24 | string $basePathToEnvFile |
||
| 25 | ): FileBasedEnvResolvingStrategy { |
||
| 26 | 2 | return new FileBasedEnvResolvingStrategy( |
|
| 27 | 2 | new FirstSuccessfulHostDetector([ |
|
| 28 | 2 | new ServerHeadersBasedHostDetector($serverHeaderToSearch), |
|
| 29 | 2 | new CliArgsBasedHostDetector($cliArgToSearch, GetOptAdapterFactory::build()) |
|
| 30 | ]), |
||
| 31 | 2 | new DotEnvFileReaderAdapter( |
|
| 32 | 2 | new PathResolver($basePathToEnvFile, new SuffixAppendFormatter(DIRECTORY_SEPARATOR)), |
|
| 33 | 2 | new FileNameResolver($envFileName) |
|
| 34 | ), |
||
| 35 | 2 | new RawEnvResolvingStrategy() |
|
| 36 | ); |
||
| 39 |