@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | public function applyHooks(MessageHookCollection $messageHookCollection) |
67 | 67 | { |
68 | - if(!empty($messageHookCollection)) |
|
68 | + if( ! empty($messageHookCollection)) |
|
69 | 69 | { |
70 | 70 | foreach($messageHookCollection as $messageHook) |
71 | 71 | { |
@@ -151,14 +151,14 @@ discard block |
||
151 | 151 | { |
152 | 152 | $retryHeader = $this->getHeader(\Puzzle\AMQP\Consumers\Retry::DEFAULT_RETRY_HEADER); |
153 | 153 | |
154 | - return (!empty($retryHeader) && (int) $retryHeader === $retryOccurence); |
|
154 | + return ( ! empty($retryHeader) && (int) $retryHeader === $retryOccurence); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | public function getRoutingKeyFromHeader() |
158 | 158 | { |
159 | 159 | $headers = $this->getHeaders(); |
160 | 160 | |
161 | - if(! array_key_exists('routing_key', $headers)) |
|
161 | + if( ! array_key_exists('routing_key', $headers)) |
|
162 | 162 | { |
163 | 163 | return null; |
164 | 164 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | |
26 | 26 | $hooks = $this->workerContext->getMessageHooks(); |
27 | 27 | |
28 | - if(!empty($hooks)) |
|
28 | + if( ! empty($hooks)) |
|
29 | 29 | { |
30 | 30 | $message->applyHooks($hooks); |
31 | 31 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | public function deployInstances($numberOfInstance) |
101 | 101 | { |
102 | - if(! empty($numberOfInstance)) |
|
102 | + if( ! empty($numberOfInstance)) |
|
103 | 103 | { |
104 | 104 | $this->instances = (int) $numberOfInstance; |
105 | 105 | } |
@@ -114,9 +114,9 @@ discard block |
||
114 | 114 | |
115 | 115 | public function deployOn($servers) |
116 | 116 | { |
117 | - if(! empty($servers)) |
|
117 | + if( ! empty($servers)) |
|
118 | 118 | { |
119 | - if(! is_array($servers)) |
|
119 | + if( ! is_array($servers)) |
|
120 | 120 | { |
121 | 121 | $servers = [$servers]; |
122 | 122 | } |
@@ -43,12 +43,12 @@ |
||
43 | 43 | 'max_execution_time' => self::DEFAULT_MAX_EXECUTION_TIME, |
44 | 44 | ); |
45 | 45 | |
46 | - if(!empty($this->retries)) |
|
46 | + if( ! empty($this->retries)) |
|
47 | 47 | { |
48 | 48 | $options['instant_retry_attempts'] = $this->retries; |
49 | 49 | } |
50 | 50 | |
51 | - if(!empty($this->delay)) |
|
51 | + if( ! empty($this->delay)) |
|
52 | 52 | { |
53 | 53 | $options['instant_retry_delay'] = $this->delay * 1000000; //computed in microseconds |
54 | 54 | } |
@@ -52,7 +52,7 @@ |
||
52 | 52 | 'retry_key_pattern' => sprintf(self::RETRY_ROUTING_KEY_PATTERN, $workerContext->queue), |
53 | 53 | ); |
54 | 54 | |
55 | - if(! empty($this->retries)) |
|
55 | + if( ! empty($this->retries)) |
|
56 | 56 | { |
57 | 57 | $options['retry_attempts'] = $this->retries; |
58 | 58 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | { |
39 | 39 | $workerNamePattern = $input->getArgument('workerNamePattern'); |
40 | 40 | |
41 | - if(!empty($workerNamePattern)) |
|
41 | + if( ! empty($workerNamePattern)) |
|
42 | 42 | { |
43 | 43 | $comment = sprintf('List of worker with following pattern: %s', $workerNamePattern); |
44 | 44 | $services = $this->workerProvider->listWithRegexFilter($workerNamePattern); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | $output->writeln(sprintf('<comment>%s</comment>', $comment)); |
53 | 53 | |
54 | - if(empty($services) || !is_array($services)) |
|
54 | + if(empty($services) || ! is_array($services)) |
|
55 | 55 | { |
56 | 56 | $output->writeln('<error>No worker found</error>'); |
57 | 57 | return; |
@@ -78,7 +78,7 @@ |
||
78 | 78 | { |
79 | 79 | $value = $input->getOption($name); |
80 | 80 | |
81 | - if(! in_array($value, ['true', 'false'])) |
|
81 | + if( ! in_array($value, ['true', 'false'])) |
|
82 | 82 | { |
83 | 83 | throw new \InvalidArgumentException(sprintf('Invalid value "%s" for option %s, expecting boolean.', $value, $name)); |
84 | 84 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | { |
36 | 36 | $exchangeParts = []; |
37 | 37 | |
38 | - if(! empty($this->exchangesPrefix)) |
|
38 | + if( ! empty($this->exchangesPrefix)) |
|
39 | 39 | { |
40 | 40 | $exchangeParts[] = trim($this->exchangesPrefix); |
41 | 41 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | public function setBody($body) |
75 | 75 | { |
76 | - if(! is_array($body)) |
|
76 | + if( ! is_array($body)) |
|
77 | 77 | { |
78 | 78 | $body = array($body); |
79 | 79 | } |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $writableMessage = new static($routingKey); |
212 | 212 | |
213 | 213 | $decodedBody = $readableMessage->getDecodedBody(); |
214 | - if(! is_array($decodedBody)) |
|
214 | + if( ! is_array($decodedBody)) |
|
215 | 215 | { |
216 | 216 | $decodedBody = array($decodedBody); |
217 | 217 | } |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | $skippedAttributes = array('timestamp', 'headers', 'app_id', 'routing_key'); |
225 | 225 | foreach($attributes as $attributeName => $value) |
226 | 226 | { |
227 | - if(! in_array($attributeName, $skippedAttributes)) |
|
227 | + if( ! in_array($attributeName, $skippedAttributes)) |
|
228 | 228 | { |
229 | 229 | $writableMessage->setAttribute($attributeName, $value); |
230 | 230 | } |