Skip to content

Commit a9384d1

Browse files
committed
use simple commands.
1 parent 821ff2a commit a9384d1

File tree

5 files changed

+24
-38
lines changed

5 files changed

+24
-38
lines changed

composer.json

+8-7
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@
77
"require": {
88
"php": ">=7.1",
99
"illuminate/queue": "^5.6",
10-
"queue-interop/amqp-interop": "0.8.x-dev",
11-
"queue-interop/queue-interop": "0.7.x-dev",
12-
"enqueue/enqueue": "0.9.x-dev",
13-
"enqueue/dsn": "0.9.x-dev"
10+
"queue-interop/amqp-interop": "^0.8",
11+
"queue-interop/queue-interop": "^0.7|^0.8",
12+
"enqueue/enqueue": "^0.9",
13+
"enqueue/dsn": "^0.9",
14+
"enqueue/simple-client": "^0.9.3"
1415
},
1516
"require-dev": {
1617
"phpunit/phpunit": "~5.5",
17-
"enqueue/enqueue": "0.9.x-dev",
18-
"enqueue/null": "0.9.x-dev",
19-
"enqueue/test": "0.9.x-dev"
18+
"enqueue/enqueue": "^0.9",
19+
"enqueue/null": "^0.9@dev",
20+
"enqueue/test": "^0.9@dev"
2021
},
2122
"autoload": {
2223
"psr-4": { "Enqueue\\LaravelQueue\\": "src/" },

src/Command/ConsumeCommand.php

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
<?php
22
namespace Enqueue\LaravelQueue\Command;
33

4-
use Enqueue\Container\Container;
54
use Enqueue\SimpleClient\SimpleClient;
5+
use Enqueue\Symfony\Client\SimpleConsumeCommand;
66

7-
class ConsumeCommand extends \Enqueue\Symfony\Client\ConsumeCommand
7+
class ConsumeCommand extends SimpleConsumeCommand
88
{
99
public function __construct(SimpleClient $client)
1010
{
11-
$container = new Container([
12-
'queue_consumer' => $client->getQueueConsumer(),
13-
'driver' => $client->getDriver(),
14-
'processor' => $client->getDelegateProcessor()
15-
]);
16-
17-
parent::__construct($container, 'queue_consumer', 'driver', 'processor');
11+
parent::__construct(
12+
$client->getQueueConsumer(),
13+
$client->getDriver(),
14+
$client->getDelegateProcessor()
15+
);
1816
}
1917
}

src/Command/ProduceCommand.php

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
<?php
22
namespace Enqueue\LaravelQueue\Command;
33

4-
use Enqueue\Container\Container;
54
use Enqueue\SimpleClient\SimpleClient;
5+
use Enqueue\Symfony\Client\SimpleProduceCommand;
66

7-
class ProduceCommand extends \Enqueue\Symfony\Client\ProduceCommand
7+
class ProduceCommand extends SimpleProduceCommand
88
{
99
public function __construct(SimpleClient $client)
1010
{
11-
$container = new Container([
12-
'producer' => $client->getProducer(),
13-
]);
14-
15-
parent::__construct($container, 'producer');
11+
parent::__construct($client->getProducer());
1612
}
1713
}

src/Command/RoutesCommand.php

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
<?php
22
namespace Enqueue\LaravelQueue\Command;
33

4-
use Enqueue\Container\Container;
54
use Enqueue\SimpleClient\SimpleClient;
5+
use Enqueue\Symfony\Client\SimpleRoutesCommand;
66

7-
class RoutesCommand extends \Enqueue\Symfony\Client\RoutesCommand
7+
class RoutesCommand extends SimpleRoutesCommand
88
{
99
public function __construct(SimpleClient $client)
1010
{
11-
$container = new Container([
12-
'driver' => $client->getDriver(),
13-
]);
14-
15-
parent::__construct($container, 'driver');
11+
parent::__construct($client->getDriver());
1612
}
1713
}

src/Command/SetupBrokerCommand.php

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
<?php
22
namespace Enqueue\LaravelQueue\Command;
33

4-
5-
use Enqueue\Container\Container;
64
use Enqueue\SimpleClient\SimpleClient;
5+
use Enqueue\Symfony\Client\SimpleSetupBrokerCommand;
76

8-
class SetupBrokerCommand extends \Enqueue\Symfony\Client\SetupBrokerCommand
7+
class SetupBrokerCommand extends SimpleSetupBrokerCommand
98
{
109
public function __construct(SimpleClient $client)
1110
{
12-
$container = new Container([
13-
'driver' => $client->getDriver(),
14-
]);
15-
16-
parent::__construct($container, 'driver');
11+
parent::__construct($client->getDriver());
1712
}
1813
}

0 commit comments

Comments
 (0)