@@ -12,7 +12,7 @@ class VersionManager
1212 */
1313 public function getCurrentVersion (): string
1414 {
15- $ config_key = config ('version.config_key ' , 'app.version ' );
15+ $ config_key = config ('version-manager .config_key ' , 'app.version ' );
1616
1717 return config ($ config_key );
1818 }
@@ -40,7 +40,7 @@ public function updateConfigFile(string $newVersion): bool
4040 $ config_path = $ this ->getConfigPath ();
4141 $ config_content = File::get ($ config_path );
4242
43- $ version_key = config ('version.version_key ' , 'version ' );
43+ $ version_key = config ('version-manager .version_key ' , 'version ' );
4444 $ pattern = "/['| \"] " .preg_quote ($ version_key )."['| \"](\s*=>\s*)['| \"](.*?)['| \"]/ " ;
4545
4646 $ updated_content = preg_replace (
@@ -61,7 +61,7 @@ public function updateConfigFile(string $newVersion): bool
6161 */
6262 public function updateRuntimeConfig (string $ newVersion ): bool
6363 {
64- $ config_key = config ('version.config_key ' , 'app.version ' );
64+ $ config_key = config ('version-manager .config_key ' , 'app.version ' );
6565 app ()['config ' ]->set ($ config_key , $ newVersion );
6666
6767 return config ($ config_key ) === $ newVersion ;
@@ -79,7 +79,7 @@ public function updateChangelog(string $newVersion): bool
7979 }
8080
8181 $ changelog_content = File::get ($ changelog_path );
82- $ unreleased_pattern = config ('version.unreleased_pattern ' , '## [Unreleased] ' );
82+ $ unreleased_pattern = config ('version-manager .unreleased_pattern ' , '## [Unreleased] ' );
8383
8484 $ date = Carbon::now ()->toDateString ();
8585 $ updated_changelog = str_replace (
@@ -122,7 +122,7 @@ public function handleGitOperations(string $newVersion): array
122122 }
123123
124124 // Commit changes
125- $ commit_message = config ('version.commit_message ' , 'chg: dev: Version set to ' );
125+ $ commit_message = config ('version-manager .commit_message ' , 'chg: dev: Version set to ' );
126126 exec ("git commit -m ' $ commit_message $ newVersion' 2>&1 " , $ output , $ return_code );
127127 if ($ return_code === 0 ) {
128128 $ results ['messages ' ][] = 'Git commit created successfully ' ;
@@ -155,22 +155,22 @@ public function handleGitOperations(string $newVersion): array
155155 */
156156 protected function getConfigPath (): string
157157 {
158- return config ('version.config_path ' );
158+ return config ('version-manager .config_path ' );
159159 }
160160
161161 /**
162162 * Get the changelog file path.
163163 */
164164 protected function getChangelogPath (): string
165165 {
166- return config ('version.changelog_path ' );
166+ return config ('version-manager .changelog_path ' );
167167 }
168168
169169 /**
170170 * Get the files to commit.
171171 */
172172 protected function getFilesToCommit (): array
173173 {
174- return config ('version.files_to_commit ' );
174+ return config ('version-manager .files_to_commit ' );
175175 }
176176}
0 commit comments