@@ -83,22 +83,22 @@ private function loadRuntimeConfiguration(Application $app, RepositoryContract $
83
83
{
84
84
if ($ app ->runningInConsole ()) {
85
85
if ($ this ->getArgv () !== null ) {
86
- // Check if the `--pretty-urls` CLI argument is set, and if so, set the config value accordingly.
87
- if (in_array ('--pretty-urls ' , $ this ->getArgv (), true )) {
88
- $ repository ->set ('hyde.pretty_urls ' , true );
89
- }
90
-
91
- // Check if the `--no-api` CLI argument is set, and if so, set the config value accordingly.
92
- if (in_array ('--no-api ' , $ this ->getArgv (), true )) {
93
- $ repository ->set ('hyde.api_calls ' , false );
94
- }
86
+ $ this ->mergeCommandLineArguments ($ repository , '--pretty-urls ' , 'hyde.pretty_urls ' );
87
+ $ this ->mergeCommandLineArguments ($ repository , '--no-api ' , 'hyde.api_calls ' );
95
88
}
96
89
97
90
$ this ->mergeRealtimeCompilerEnvironment ($ repository , 'HYDE_SERVER_DASHBOARD ' , 'hyde.server.dashboard.enabled ' );
98
91
$ this ->mergeRealtimeCompilerEnvironment ($ repository , 'HYDE_PRETTY_URLS ' , 'hyde.pretty_urls ' );
99
92
}
100
93
}
101
94
95
+ private function mergeCommandLineArguments (RepositoryContract $ repository , string $ argumentName , string $ configKey ): void
96
+ {
97
+ if (in_array ($ argumentName , $ this ->getArgv (), true )) {
98
+ $ repository ->set ($ configKey , true );
99
+ }
100
+ }
101
+
102
102
private function mergeRealtimeCompilerEnvironment (RepositoryContract $ repository , string $ environmentKey , string $ configKey ): void
103
103
{
104
104
if ($ this ->getEnv ($ environmentKey ) !== false ) {
0 commit comments