1 | <?php |
||
16 | class ConfigurationFactory |
||
17 | { |
||
18 | /** |
||
19 | * Creates a configuration based on a YAML configuration file. |
||
20 | * |
||
21 | * @param string $configFile |
||
22 | * @return Configuration |
||
23 | */ |
||
24 | 3 | public static function getConfigurationByConfigFile($configFile) |
|
37 | |||
38 | /** |
||
39 | * Creates a configuration based on a YAML configuration file, command line options and command line arguments. |
||
40 | * The command line options will be merged into the configuration. |
||
41 | * The command line arguments will be merged into the configuration as well. |
||
42 | * |
||
43 | * The command line options got a higher priority as the configuration file. |
||
44 | * The command line arguments will be added to the configuration file and not overwritten. |
||
45 | * |
||
46 | * @param string $configFile |
||
47 | * @param InputExtendedInterface $input |
||
48 | * @return Configuration |
||
49 | */ |
||
50 | 4 | public static function getConfigurationByConfigFileAndCommandOptionsAndArguments($configFile, InputExtendedInterface $input) |
|
63 | |||
64 | /** |
||
65 | * Merges the command line options into a existing configuration. |
||
66 | * |
||
67 | * E.g. |
||
68 | * * Database credentials |
||
69 | * * SSH settings |
||
70 | * |
||
71 | * @param Configuration $config |
||
72 | * @param InputExtendedInterface $input |
||
73 | * @return Configuration |
||
74 | */ |
||
75 | 4 | protected static function mergeCommandOptionsIntoConfiguration(Configuration $config, InputExtendedInterface $input) |
|
100 | |||
101 | /** |
||
102 | * Merges the command line arguments into a existing configuration. |
||
103 | * |
||
104 | * E.g. |
||
105 | * * Instances |
||
106 | * |
||
107 | * @param Configuration $config |
||
108 | * @param InputExtendedInterface $input |
||
109 | * @return Configuration |
||
110 | */ |
||
111 | 4 | protected static function mergeCommandArgumentsIntoConfiguration(Configuration $config, InputExtendedInterface $input) |
|
128 | } |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.