Skip to content

Commit 68297bc

Browse files
committed
Merge branch 'pr-354'
2 parents 28a5903 + 51b0011 commit 68297bc

File tree

6 files changed

+146
-86
lines changed

6 files changed

+146
-86
lines changed

pkg/amqp-bunny/AmqpContext.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public function bind(InteropAmqpBind $bind)
249249
(bool) ($bind->getFlags() & InteropAmqpBind::FLAG_NOWAIT),
250250
$bind->getArguments()
251251
);
252-
// bind queue to exchange
252+
// bind queue to exchange
253253
} elseif ($bind->getSource() instanceof InteropAmqpQueue) {
254254
$this->getBunnyChannel()->queueBind(
255255
$bind->getSource()->getQueueName(),
@@ -258,7 +258,7 @@ public function bind(InteropAmqpBind $bind)
258258
(bool) ($bind->getFlags() & InteropAmqpBind::FLAG_NOWAIT),
259259
$bind->getArguments()
260260
);
261-
// bind exchange to queue
261+
// bind exchange to queue
262262
} else {
263263
$this->getBunnyChannel()->queueBind(
264264
$bind->getTarget()->getQueueName(),
@@ -288,15 +288,15 @@ public function unbind(InteropAmqpBind $bind)
288288
(bool) ($bind->getFlags() & InteropAmqpBind::FLAG_NOWAIT),
289289
$bind->getArguments()
290290
);
291-
// bind queue to exchange
291+
// bind queue to exchange
292292
} elseif ($bind->getSource() instanceof InteropAmqpQueue) {
293293
$this->getBunnyChannel()->queueUnbind(
294294
$bind->getSource()->getQueueName(),
295295
$bind->getTarget()->getTopicName(),
296296
$bind->getRoutingKey(),
297297
$bind->getArguments()
298298
);
299-
// bind exchange to queue
299+
// bind exchange to queue
300300
} else {
301301
$this->getBunnyChannel()->queueUnbind(
302302
$bind->getTarget()->getQueueName(),

pkg/amqp-lib/AmqpContext.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public function bind(InteropAmqpBind $bind)
242242
(bool) ($bind->getFlags() & InteropAmqpBind::FLAG_NOWAIT),
243243
$bind->getArguments()
244244
);
245-
// bind queue to exchange
245+
// bind queue to exchange
246246
} elseif ($bind->getSource() instanceof InteropAmqpQueue) {
247247
$this->getLibChannel()->queue_bind(
248248
$bind->getSource()->getQueueName(),
@@ -251,7 +251,7 @@ public function bind(InteropAmqpBind $bind)
251251
(bool) ($bind->getFlags() & InteropAmqpBind::FLAG_NOWAIT),
252252
$bind->getArguments()
253253
);
254-
// bind exchange to queue
254+
// bind exchange to queue
255255
} else {
256256
$this->getLibChannel()->queue_bind(
257257
$bind->getTarget()->getQueueName(),
@@ -281,15 +281,15 @@ public function unbind(InteropAmqpBind $bind)
281281
(bool) ($bind->getFlags() & InteropAmqpBind::FLAG_NOWAIT),
282282
$bind->getArguments()
283283
);
284-
// bind queue to exchange
284+
// bind queue to exchange
285285
} elseif ($bind->getSource() instanceof InteropAmqpQueue) {
286286
$this->getLibChannel()->queue_unbind(
287287
$bind->getSource()->getQueueName(),
288288
$bind->getTarget()->getTopicName(),
289289
$bind->getRoutingKey(),
290290
$bind->getArguments()
291291
);
292-
// bind exchange to queue
292+
// bind exchange to queue
293293
} else {
294294
$this->getLibChannel()->queue_unbind(
295295
$bind->getTarget()->getQueueName(),

pkg/enqueue-bundle/DependencyInjection/Configuration.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,21 @@
1010

1111
class Configuration implements ConfigurationInterface
1212
{
13+
private $debug;
14+
1315
/**
1416
* @var TransportFactoryInterface[]
1517
*/
1618
private $factories;
1719

1820
/**
1921
* @param TransportFactoryInterface[] $factories
22+
* @param bool $debug
2023
*/
21-
public function __construct(array $factories)
24+
public function __construct(array $factories, $debug)
2225
{
2326
$this->factories = $factories;
27+
$this->debug = $debug;
2428
}
2529

2630
/**
@@ -42,7 +46,7 @@ public function getConfigTreeBuilder()
4246

4347
$rootNode->children()
4448
->arrayNode('client')->children()
45-
->booleanNode('traceable_producer')->defaultFalse()->end()
49+
->booleanNode('traceable_producer')->defaultValue($this->debug)->end()
4650
->scalarNode('prefix')->defaultValue('enqueue')->end()
4751
->scalarNode('app_name')->defaultValue('app')->end()
4852
->scalarNode('router_topic')->defaultValue(Config::DEFAULT_PROCESSOR_QUEUE_NAME)->cannotBeEmpty()->end()

pkg/enqueue-bundle/DependencyInjection/EnqueueExtension.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function addTransportFactory(TransportFactoryInterface $transportFactory)
5656
*/
5757
public function load(array $configs, ContainerBuilder $container)
5858
{
59-
$config = $this->processConfiguration(new Configuration($this->factories), $configs);
59+
$config = $this->processConfiguration($this->getConfiguration($configs, $container), $configs);
6060

6161
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
6262
$loader->load('services.yml');
@@ -77,7 +77,7 @@ public function load(array $configs, ContainerBuilder $container)
7777
}
7878
}
7979

80-
if (isset($config['transport']['default']['alias']) && false == isset($config['transport'][$config['transport']['default']['alias']])) {
80+
if (isset($config['transport']['default']['alias']) && !isset($config['transport'][$config['transport']['default']['alias']])) {
8181
throw new \LogicException(sprintf('Transport is not enabled: %s', $config['transport']['default']['alias']));
8282
}
8383

@@ -95,7 +95,7 @@ public function load(array $configs, ContainerBuilder $container)
9595
$container->setParameter('enqueue.client.router_queue_name', $config['client']['router_queue']);
9696
$container->setParameter('enqueue.client.default_queue_name', $config['client']['default_processor_queue']);
9797

98-
if (false == empty($config['client']['traceable_producer'])) {
98+
if ($config['client']['traceable_producer']) {
9999
$container->register(TraceableProducer::class, TraceableProducer::class)
100100
->setDecoratedService(Producer::class)
101101
->addArgument(new Reference(sprintf('%s.inner', TraceableProducer::class)))
@@ -125,7 +125,7 @@ public function load(array $configs, ContainerBuilder $container)
125125
}
126126

127127
if ($config['job']) {
128-
if (false == class_exists(Job::class)) {
128+
if (!class_exists(Job::class)) {
129129
throw new \LogicException('Seems "enqueue/job-queue" is not installed. Please fix this issue.');
130130
}
131131

@@ -167,7 +167,7 @@ public function getConfiguration(array $config, ContainerBuilder $container)
167167

168168
$container->addResource(new FileResource($rc->getFileName()));
169169

170-
return new Configuration($this->factories);
170+
return new Configuration($this->factories, $container->getParameter('kernel.debug'));
171171
}
172172

173173
public function prepend(ContainerBuilder $container)
@@ -177,19 +177,19 @@ public function prepend(ContainerBuilder $container)
177177

178178
private function registerJobQueueDoctrineEntityMapping(ContainerBuilder $container)
179179
{
180-
if (false == class_exists(Job::class)) {
180+
if (!class_exists(Job::class)) {
181181
return;
182182
}
183183

184184
$bundles = $container->getParameter('kernel.bundles');
185185

186-
if (false == isset($bundles['DoctrineBundle'])) {
186+
if (!isset($bundles['DoctrineBundle'])) {
187187
return;
188188
}
189189

190190
foreach ($container->getExtensionConfig('doctrine') as $config) {
191191
// do not register mappings if dbal not configured.
192-
if (false == empty($config['dbal'])) {
192+
if (!empty($config['dbal'])) {
193193
$rc = new \ReflectionClass(Job::class);
194194
$jobQueueRootDir = dirname($rc->getFileName());
195195
$container->prependExtensionConfig('doctrine', [

0 commit comments

Comments
 (0)