1 | <?php |
||
25 | class Config extends Base |
||
26 | { |
||
27 | /** |
||
28 | * Does git have a configuration key. |
||
29 | * |
||
30 | * @param string $name |
||
31 | * @return boolean |
||
32 | */ |
||
33 | 4 | public function has(string $name) : bool |
|
43 | |||
44 | /** |
||
45 | * Get a configuration key value. |
||
46 | * |
||
47 | * @param string $name |
||
48 | * @return string |
||
49 | */ |
||
50 | 2 | public function get(string $name) : string |
|
56 | |||
57 | /** |
||
58 | * Get config values without throwing exceptions. |
||
59 | * |
||
60 | * You can provide a default value to return. |
||
61 | * By default the return value on unset config values is the empty string. |
||
62 | * |
||
63 | * @param string $name Name of the config value to retrieve |
||
64 | * @param string $default Value to return if config value is not set, empty string by default |
||
65 | * @return string |
||
66 | */ |
||
67 | 2 | public function getSafely(string $name, string $default = '') |
|
71 | |||
72 | /** |
||
73 | * Return a map of all configuration settings. |
||
74 | * |
||
75 | * For example: ['color.branch' => 'auto', 'color.diff' => 'auto] |
||
76 | * |
||
77 | * @return array |
||
78 | */ |
||
79 | 1 | public function getSettings() : array |
|
86 | |||
87 | /** |
||
88 | * Run the get config command. |
||
89 | * |
||
90 | * @param string $name |
||
91 | * @return \SebastianFeldmann\Cli\Command\Runner\Result |
||
92 | */ |
||
93 | 5 | private function configCommand(string $name) : Result |
|
100 | } |
||
101 |