Skip to content

Commit 20d6a6c

Browse files
Charles-Eric GorronCharles-Eric Gorron
authored andcommitted
Review Symfony components dependencies: HttpKernel and FrameworkBundle are not necessary for a simple console application.
1 parent 3dd1b63 commit 20d6a6c

File tree

5 files changed

+45
-13
lines changed

5 files changed

+45
-13
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ php:
66
- 5.5
77
- 5.6
88
- hhvm
9-
9+
1010
matrix:
1111
allow_failures:
1212
- php: hhvm
@@ -15,6 +15,9 @@ env:
1515
- SYMFONY_VERSION="2.1.*"
1616
- SYMFONY_VERSION="2.2.*"
1717
- SYMFONY_VERSION="2.3.*"
18+
- SYMFONY_VERSION="2.4.*"
19+
- SYMFONY_VERSION="2.5.*"
20+
- SYMFONY_VERSION="2.6.*"
1821

1922
before_script:
2023
- composer self-update

Command/BaseRabbitMqCommand.php

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,30 @@
22

33
namespace OldSound\RabbitMqBundle\Command;
44

5-
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand as Command;
5+
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
6+
use Symfony\Component\DependencyInjection\ContainerInterface;
7+
use Symfony\Component\Console\Command\Command;
68

7-
abstract class BaseRabbitMqCommand extends Command
9+
abstract class BaseRabbitMqCommand extends Command implements ContainerAwareInterface
810
{
11+
/**
12+
* @var ContainerInterface
13+
*/
14+
protected $container;
15+
16+
/**
17+
* {@inheritDoc}
18+
*/
19+
public function setContainer(ContainerInterface $container = null)
20+
{
21+
$this->container = $container;
22+
}
23+
24+
/**
25+
* @return ContainerInterface
26+
*/
27+
public function getContainer()
28+
{
29+
return $this->container;
30+
}
931
}

DependencyInjection/OldSoundRabbitMqExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
66
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
7-
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
7+
use Symfony\Component\DependencyInjection\Extension\Extension;
88
use Symfony\Component\DependencyInjection\ContainerBuilder;
99
use Symfony\Component\DependencyInjection\Definition;
1010
use Symfony\Component\DependencyInjection\Reference;

Tests/Command/BaseCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ abstract class BaseCommandTest extends \PHPUnit_Framework_TestCase
1111

1212
protected function setUp()
1313
{
14-
$this->application = $this->getMockBuilder('Symfony\\Bundle\\FrameworkBundle\\Console\\Application')
14+
$this->application = $this->getMockBuilder('Symfony\\Component\\Console\\Application')
1515
->disableOriginalConstructor()
1616
->getMock();
1717
$this->definition = $this->getMockBuilder('Symfony\\Component\\Console\\Input\\InputDefinition')
@@ -26,4 +26,4 @@ protected function setUp()
2626
->method('getArguments')
2727
->will($this->returnValue(array()));
2828
}
29-
}
29+
}

composer.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
{
22
"name": "oldsound/rabbitmq-bundle",
33
"description": "Integrates php-amqplib with Symfony2 and RabbitMq",
4-
"keywords": ["symfony2", "rabbitmq", "message", "queue"],
4+
"keywords": ["symfony2", "rabbitmq", "message", "queue", "amqp"],
55
"type": "symfony-bundle",
66
"license": "MIT",
77
"authors": [{
88
"name" : "Alvaro Videla"
99
}],
1010
"require": {
11-
"php" : ">=5.3.0",
12-
"symfony/framework-bundle" : "~2.1",
13-
"symfony/yaml": "~2.0",
14-
"videlalvaro/php-amqplib" : "~2.4.0"
11+
"php" : ">=5.3.0",
12+
"symfony/dependency-injection" : "~2.1",
13+
"symfony/event-dispatcher" : "~2.1",
14+
"symfony/config" : "~2.1",
15+
"symfony/yaml" : "~2.1",
16+
"symfony/console" : "~2.1",
17+
"videlalvaro/php-amqplib" : "~2.4.0"
18+
},
19+
"suggest": {
20+
"symfony/framework-bundle" : "To use this lib as a full Symfony Bundle and to use the profiler data collector"
1521
},
1622
"require-dev": {
17-
"symfony/console": "~2.0",
18-
"symfony/serializer": "~2.6"
23+
"symfony/serializer": "~2.3",
24+
"symfony/debug" : "~2.3",
25+
"phpunit/phpunit" : ">=3.7.20"
1926
},
2027
"extra": {
2128
"branch-alias": {

0 commit comments

Comments
 (0)