@@ -20,59 +20,66 @@ class Config
20
20
/**
21
21
* @var string
22
22
*/
23
- private $ appName ;
23
+ private $ separator ;
24
24
25
25
/**
26
26
* @var string
27
27
*/
28
- private $ routerTopicName ;
28
+ private $ app ;
29
29
30
30
/**
31
31
* @var string
32
32
*/
33
- private $ routerQueueName ;
33
+ private $ routerTopic ;
34
34
35
35
/**
36
36
* @var string
37
37
*/
38
- private $ defaultProcessorQueueName ;
38
+ private $ routerQueue ;
39
39
40
40
/**
41
41
* @var string
42
42
*/
43
- private $ routerProcessorName ;
43
+ private $ defaultQueue ;
44
+
45
+ /**
46
+ * @var string
47
+ */
48
+ private $ routerProcessor ;
44
49
45
50
/**
46
51
* @var array
47
52
*/
48
53
private $ transportConfig ;
49
54
50
- public function __construct (string $ prefix , string $ appName , string $ routerTopicName , string $ routerQueueName , string $ defaultProcessorQueueName , string $ routerProcessorName , array $ transportConfig = [])
55
+ public function __construct (string $ prefix , string $ app , string $ routerTopic , string $ routerQueue , string $ defaultQueue , string $ routerProcessor , array $ transportConfig = [])
51
56
{
52
57
$ this ->prefix = trim ($ prefix );
53
- $ this ->appName = trim ($ appName );
58
+ $ this ->app = trim ($ app );
54
59
55
- $ this ->routerTopicName = trim ($ routerTopicName );
56
- if (empty ($ this ->routerTopicName )) {
60
+ $ this ->routerTopic = trim ($ routerTopic );
61
+ if (empty ($ this ->routerTopic )) {
57
62
throw new \InvalidArgumentException ('Router topic is empty. ' );
58
63
}
59
64
60
- $ this ->routerQueueName = trim ($ routerQueueName );
61
- if (empty ($ this ->routerQueueName )) {
65
+ $ this ->routerQueue = trim ($ routerQueue );
66
+ if (empty ($ this ->routerQueue )) {
62
67
throw new \InvalidArgumentException ('Router queue is empty. ' );
63
68
}
64
69
65
- $ this ->defaultProcessorQueueName = trim ($ defaultProcessorQueueName );
66
- if (empty ($ this ->defaultProcessorQueueName )) {
70
+ $ this ->defaultQueue = trim ($ defaultQueue );
71
+ if (empty ($ this ->defaultQueue )) {
67
72
throw new \InvalidArgumentException ('Default processor queue name is empty. ' );
68
73
}
69
74
70
- $ this ->routerProcessorName = trim ($ routerProcessorName );
71
- if (empty ($ this ->routerProcessorName )) {
75
+ $ this ->routerProcessor = trim ($ routerProcessor );
76
+ if (empty ($ this ->routerProcessor )) {
72
77
throw new \InvalidArgumentException ('Router processor name is empty. ' );
73
78
}
74
79
75
80
$ this ->transportConfig = $ transportConfig ;
81
+
82
+ $ this ->separator = '. ' ;
76
83
}
77
84
78
85
public function getPrefix (): string
@@ -82,32 +89,32 @@ public function getPrefix(): string
82
89
83
90
public function getSeparator (): string
84
91
{
85
- return ' . ' ;
92
+ return $ this -> separator ;
86
93
}
87
94
88
- public function getAppName (): string
95
+ public function getApp (): string
89
96
{
90
- return $ this ->appName ;
97
+ return $ this ->app ;
91
98
}
92
99
93
- public function getRouterTopicName (): string
100
+ public function getRouterTopic (): string
94
101
{
95
- return $ this ->routerTopicName ;
102
+ return $ this ->routerTopic ;
96
103
}
97
104
98
- public function getRouterQueueName (): string
105
+ public function getRouterQueue (): string
99
106
{
100
- return $ this ->routerQueueName ;
107
+ return $ this ->routerQueue ;
101
108
}
102
109
103
- public function getDefaultProcessorQueueName (): string
110
+ public function getDefaultQueue (): string
104
111
{
105
- return $ this ->defaultProcessorQueueName ;
112
+ return $ this ->defaultQueue ;
106
113
}
107
114
108
- public function getRouterProcessorName (): string
115
+ public function getRouterProcessor (): string
109
116
{
110
- return $ this ->routerProcessorName ;
117
+ return $ this ->routerProcessor ;
111
118
}
112
119
113
120
/**
@@ -122,20 +129,20 @@ public function getTransportOption(string $name, $default = null)
122
129
123
130
public static function create (
124
131
string $ prefix = null ,
125
- string $ appName = null ,
126
- string $ routerTopicName = null ,
127
- string $ routerQueueName = null ,
128
- string $ defaultProcessorQueueName = null ,
129
- string $ routerProcessorName = null ,
132
+ string $ app = null ,
133
+ string $ routerTopic = null ,
134
+ string $ routerQueue = null ,
135
+ string $ defaultQueue = null ,
136
+ string $ routerProcessor = null ,
130
137
array $ transportConfig = []
131
138
): self {
132
139
return new static (
133
140
$ prefix ?: '' ,
134
- $ appName ?: '' ,
135
- $ routerTopicName ?: 'router ' ,
136
- $ routerQueueName ?: 'default ' ,
137
- $ defaultProcessorQueueName ?: 'default ' ,
138
- $ routerProcessorName ?: 'router ' ,
141
+ $ app ?: '' ,
142
+ $ routerTopic ?: 'router ' ,
143
+ $ routerQueue ?: 'default ' ,
144
+ $ defaultQueue ?: 'default ' ,
145
+ $ routerProcessor ?: 'router ' ,
139
146
$ transportConfig
140
147
);
141
148
}
0 commit comments