File tree Expand file tree Collapse file tree 3 files changed +24
-10
lines changed Expand file tree Collapse file tree 3 files changed +24
-10
lines changed Original file line number Diff line number Diff line change @@ -11,14 +11,14 @@ Only the latest version will get new features. Bug fixes will be provided using
1111
1212| Package Version | Laravel Version | Bug Fixes Until | |
1313| -----------------| -----------------| -------------------| ---------------------------------------------------------------------------------------------|
14- | 1 | 05 | December 24th, 2024 | [ Documentation] ( https://github.com/vyuldashev/laravel-queue-rabbitmq/blob/master/README.md ) |
14+ | 1 | 06 | December 24th, 2024 | [ Documentation] ( https://github.com/vyuldashev/laravel-queue-rabbitmq/blob/master/README.md ) |
1515
1616## Installation
1717
1818You can install this package via composer using this command:
1919
2020```
21- composer require salesmessage/php-lib-rabbitmq:^1.05 --ignore-platform-reqs
21+ composer require salesmessage/php-lib-rabbitmq:^1.06 --ignore-platform-reqs
2222```
2323
2424The package will automatically register itself.
Original file line number Diff line number Diff line change 3434 },
3535 "extra" : {
3636 "branch-alias" : {
37- "dev-master" : " 1.05 -dev"
37+ "dev-master" : " 1.06 -dev"
3838 },
3939 "laravel" : {
4040 "providers" : [
Original file line number Diff line number Diff line change 33namespace Salesmessage \LibRabbitMQ \Services ;
44
55use Symfony \Component \Yaml \Yaml ;
6+ use Throwable ;
67
78class GroupsService
89{
@@ -13,13 +14,7 @@ class GroupsService
1314
1415 public function __construct ()
1516 {
16- try {
17- $ configData = (array ) Yaml::parseFile (base_path () . '/rabbit-groups.yml ' );
18- } catch (Throwable $ exception ) {
19- $ configData = [];
20- }
21-
22- $ this ->configData = $ configData ;
17+ $ this ->configData = $ this ->loadConfigData ();
2318 }
2419
2520 /**
@@ -42,5 +37,24 @@ public function getAllGroupsNames(): array
4237
4338 return array_filter (array_keys ($ this ->configData ['groups ' ]));
4439 }
40+
41+ /**
42+ * @return array
43+ */
44+ private function loadConfigData (): array
45+ {
46+ $ filePath = base_path () . '/rabbit-groups.yml ' ;
47+ if (!file_exists ($ filePath )) {
48+ return [];
49+ }
50+
51+ try {
52+ $ configData = (array ) Yaml::parseFile ($ filePath );
53+ } catch (Throwable $ exception ) {
54+ $ configData = [];
55+ }
56+
57+ return $ configData ;
58+ }
4559}
4660
You can’t perform that action at this time.
0 commit comments