From 23fecc22f19217780396256acd25cfc5727bf08d Mon Sep 17 00:00:00 2001 From: Anton Ukhanev Date: Fri, 3 Feb 2017 09:24:34 +0100 Subject: [PATCH 01/20] `CompositeContainer` now implements correct writable interface (#4) --- src/CompositeContainer.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/CompositeContainer.php b/src/CompositeContainer.php index 680632c..c9f51fe 100644 --- a/src/CompositeContainer.php +++ b/src/CompositeContainer.php @@ -3,6 +3,7 @@ namespace Dhii\Di; use Exception; +use Interop\Container\ContainerInterface as BaseContainerInterface; /** * Concrete implementation of a container that can have child containers. @@ -11,7 +12,7 @@ */ class CompositeContainer extends AbstractCompositeContainer implements ParentAwareContainerInterface, - CompositeContainerInterface + WritableCompositeContainerInterface { /** * Constructor. @@ -70,11 +71,11 @@ public function getContainers() * * @since 0.1 * - * @param ContainerInterface $container The container to add. + * @param BaseContainerInterface $container The container to add. * * @return $this This instance. */ - public function add(ContainerInterface $container) + public function add(BaseContainerInterface $container) { $this->_add($container); From da553db1f0f97d8c6ef2ce2a73d34496f0b51d88 Mon Sep 17 00:00:00 2001 From: Anton Ukhanev Date: Fri, 3 Feb 2017 09:26:23 +0100 Subject: [PATCH 02/20] Added tests for `CompositeContainer#add()` (#4) This fixes #4. --- test/functional/CompositeContainerTest.php | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/test/functional/CompositeContainerTest.php b/test/functional/CompositeContainerTest.php index 4d705ff..d9c89d4 100644 --- a/test/functional/CompositeContainerTest.php +++ b/test/functional/CompositeContainerTest.php @@ -76,6 +76,23 @@ public function createContainer(ServiceProvider $definitions, ContainerInterface return $mock; } + /** + * Creates an instance of the most basic interop container. + * + * @since [*next-version*] + * + * @return ContainerInterface The new instance. + */ + public function createBaseContainer() + { + $instance = $this->mock('Interop\\Container\\ContainerInterface') + ->get() + ->has() + ->new(); + + return $instance; + } + /** * Create a service definition that returns a simple value. * @@ -92,6 +109,34 @@ public function createDefinition($value) }; } + /** + * Tests whether a valid instance of the test subject can be created. + * + * @since [*next-version*] + */ + public function testCanBeCreated() + { + $subject = $this->createInstance(); + $this->assertInstanceOf('Dhii\\Di\\CompositeContainerInterface', $subject, 'A valid instance of the test subject could not be created'); + $this->assertInstanceOf('Dhii\\Di\\WritableCompositeContainerInterface', $subject, 'Test subject does not implement required interface'); + $this->assertInstanceOf('Dhii\\Di\\ParentAwareContainerInterface', $subject, 'Test subject does not implement required interface'); + $this->assertInstanceOf('Interop\\Container\\ContainerInterface', $subject, 'Test subject does not implement required interface'); + } + + /** + * Tests whether an interop container can get added to the composite container. + * + * @since [*next-version*] + */ + public function testAdd() + { + $subject = $this->createInstance(); + $child = $this->createBaseContainer(); + + $subject->add($child); + $this->assertContains($child, $subject->getContainers(), 'Added container is not in the resulting container set'); + } + /** * Tests whether services of child containers can be correctly retrieved from parent. * No relationships between services. From d997f9e5147d9804f8d071f314b9c06db34384c9 Mon Sep 17 00:00:00 2001 From: Anton Ukhanev Date: Fri, 3 Feb 2017 09:45:04 +0100 Subject: [PATCH 03/20] Constructor now accepts interop interface (#5) --- src/CompositeContainer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CompositeContainer.php b/src/CompositeContainer.php index c9f51fe..abb5bb4 100644 --- a/src/CompositeContainer.php +++ b/src/CompositeContainer.php @@ -19,9 +19,9 @@ class CompositeContainer extends AbstractCompositeContainer implements * * @since 0.1 * - * @param ContainerInterface $parent The parent container of this instance. + * @param BaseContainerInterface $parent The parent container of this instance. */ - public function __construct(ContainerInterface $parent = null) + public function __construct(BaseContainerInterface $parent = null) { $this->_setParentContainer($parent); } From f463c6a3f4a78a5b491da1adc8de321624a3dc00 Mon Sep 17 00:00:00 2001 From: Anton Ukhanev Date: Fri, 3 Feb 2017 09:45:29 +0100 Subject: [PATCH 04/20] Added test for constructor (#5) This fixes #5 --- test/functional/CompositeContainerTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/functional/CompositeContainerTest.php b/test/functional/CompositeContainerTest.php index d9c89d4..e1d1f60 100644 --- a/test/functional/CompositeContainerTest.php +++ b/test/functional/CompositeContainerTest.php @@ -137,6 +137,20 @@ public function testAdd() $this->assertContains($child, $subject->getContainers(), 'Added container is not in the resulting container set'); } + /** + * Tests that the constructor accepts correct args. + * + * @since [*next-version*] + */ + public function testConstructor() + { + $class = static::TEST_SUBJECT_CLASSNAME; + $parent = $this->createBaseContainer(); + $subject = $this->createInstance($parent); + + $this->assertSame($parent, $subject->getParentContainer(), 'Parent set in constructor could not be retrieved'); + } + /** * Tests whether services of child containers can be correctly retrieved from parent. * No relationships between services. From fef1f01b250ed64d6b705ff88e595cf369c339d1 Mon Sep 17 00:00:00 2001 From: Anton Ukhanev Date: Fri, 3 Feb 2017 09:58:05 +0100 Subject: [PATCH 05/20] Replaced next version placeholders in tests --- test/functional/CompositeContainerTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/functional/CompositeContainerTest.php b/test/functional/CompositeContainerTest.php index e1d1f60..d51e537 100644 --- a/test/functional/CompositeContainerTest.php +++ b/test/functional/CompositeContainerTest.php @@ -79,7 +79,7 @@ public function createContainer(ServiceProvider $definitions, ContainerInterface /** * Creates an instance of the most basic interop container. * - * @since [*next-version*] + * @since 0.1.1 * * @return ContainerInterface The new instance. */ @@ -112,7 +112,7 @@ public function createDefinition($value) /** * Tests whether a valid instance of the test subject can be created. * - * @since [*next-version*] + * @since 0.1.1 */ public function testCanBeCreated() { @@ -126,7 +126,7 @@ public function testCanBeCreated() /** * Tests whether an interop container can get added to the composite container. * - * @since [*next-version*] + * @since 0.1.1 */ public function testAdd() { @@ -140,7 +140,7 @@ public function testAdd() /** * Tests that the constructor accepts correct args. * - * @since [*next-version*] + * @since 0.1.1 */ public function testConstructor() { From 627538cec1a56cbe03152b7f622bb7ccd714debd Mon Sep 17 00:00:00 2001 From: Anton Ukhanev Date: Fri, 3 Feb 2017 09:59:56 +0100 Subject: [PATCH 06/20] Updated changelog --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21e4158..6626b18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,4 +9,11 @@ Initial release, containing concrete implementations. ### Added - Implementations of regular and compound containers, with service provider support. -- Tests. \ No newline at end of file +- Tests. + +## [0.1.1] - 2017-02-03 +Non-BC-breaking bugfixes. + +### Fixed +- `CompositeContainer#__construct()` not accepting interop containers. +- `CompositeContainer#add()` not implementing interface method. From 3898b3866de2023ea61d22914a883ce603bf7803 Mon Sep 17 00:00:00 2001 From: Anton Ukhanev Date: Fri, 3 Feb 2017 10:12:02 +0100 Subject: [PATCH 07/20] Added build dir to ignore list --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e91e966..ab728c9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /nbproject/private/ /test/coverage/ /test/log/ +/build/ From 98b8649ea6076192390033d5922795979d0552f1 Mon Sep 17 00:00:00 2001 From: Anton Ukhanev Date: Fri, 3 Feb 2017 10:12:17 +0100 Subject: [PATCH 08/20] Excluding some files and directories from git archive --- .gitattributes | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..852306a --- /dev/null +++ b/.gitattributes @@ -0,0 +1,7 @@ +test export-ignore +nbproject export-ignore +.codeclimate.yml export-ignore +.php_cs export-ignore +.travis.yml export-ignore +composer.lock export-ignore +phpunit.xml export-ignore From b1be10be3345cdce320900cce233d1f099227efb Mon Sep 17 00:00:00 2001 From: Anton Ukhanev Date: Fri, 3 Feb 2017 10:21:18 +0100 Subject: [PATCH 09/20] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6626b18..54ef02b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ Initial release, containing concrete implementations. ## [0.1.1] - 2017-02-03 Non-BC-breaking bugfixes. +Reduced size of dist archive. ### Fixed - `CompositeContainer#__construct()` not accepting interop containers. From 0f3d32b1f9259d37d8ebe34ce9f7ba587e1ffd87 Mon Sep 17 00:00:00 2001 From: Miguel Muscat Date: Fri, 3 Feb 2017 11:32:36 +0100 Subject: [PATCH 10/20] Added tests for exception creation methods (#9) --- test/functional/CompositeContainerTest.php | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/test/functional/CompositeContainerTest.php b/test/functional/CompositeContainerTest.php index e1d1f60..e9af1b7 100644 --- a/test/functional/CompositeContainerTest.php +++ b/test/functional/CompositeContainerTest.php @@ -3,6 +3,8 @@ namespace Dhii\Di\FuncTest; use Dhii\Di\CompositeContainer; +use Dhii\Di\Exception\NotFoundException; +use Dhii\Di\Exception\ContainerException; use Dhii\Di\ParentAwareContainerInterface; use Dhii\Di\ServiceProvider as ServiceProvider2; use Interop\Container\ContainerInterface; @@ -337,4 +339,34 @@ public function testThreeLevelComplexRetrieval() $this->assertEquals($expected, $actual, 'The container structure did not resolve services correctly'); } + + /** + * Tests the method that creates a {@see NotFoundException}. + * + * @since [*next-version*] + */ + public function testCreateNotFoundException() + { + $subject = $this->createInstance(); + + $expected = new NotFoundException('test message', 3, null); + $exception = $subject->this()->_createNotFoundException('test message', 3, null); + + $this->assertEquals($expected, $exception); + } + + /** + * Tests the method that creates a {@see ContainerException}. + * + * @since [*next-version*] + */ + public function testContainerException() + { + $subject = $this->createInstance(); + + $expected = new ContainerException('test message', 3, null); + $exception = $subject->this()->_createContainerException('test message', 3, null); + + $this->assertEquals($expected, $exception); + } } From 25470a30e27a0a693288832c266f451701c60787 Mon Sep 17 00:00:00 2001 From: Miguel Muscat Date: Fri, 3 Feb 2017 11:32:36 +0100 Subject: [PATCH 11/20] Fixed use of exception classes (#9) --- src/CompositeContainer.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/CompositeContainer.php b/src/CompositeContainer.php index abb5bb4..52e8ce0 100644 --- a/src/CompositeContainer.php +++ b/src/CompositeContainer.php @@ -3,6 +3,8 @@ namespace Dhii\Di; use Exception; +use Dhii\Di\Exception\ContainerException; +use Dhii\Di\Exception\NotFoundException; use Interop\Container\ContainerInterface as BaseContainerInterface; /** From 4fc87e078630058f07bf66709e41f7ca9826142d Mon Sep 17 00:00:00 2001 From: Miguel Muscat Date: Fri, 3 Feb 2017 11:32:36 +0100 Subject: [PATCH 12/20] Fixed code standards --- test/functional/CompositeContainerTest.php | 82 ++++++++++++---------- 1 file changed, 44 insertions(+), 38 deletions(-) diff --git a/test/functional/CompositeContainerTest.php b/test/functional/CompositeContainerTest.php index e9af1b7..e8b4a2b 100644 --- a/test/functional/CompositeContainerTest.php +++ b/test/functional/CompositeContainerTest.php @@ -61,9 +61,9 @@ public function createServiceProvider($definitions) * * @since 0.1 * - * @param ServiceProvider $definitions The service provider. - * @param ContainerInterface $parent The container instance which is the be the parent container. - * @param bool $isMutable If true, the container will have its parent container be mutable; immutable if false. + * @param ServiceProvider $definitions The service provider. + * @param ContainerInterface $parent The container instance which is the be the parent container. + * @param bool $isMutable If true, the container will have its parent container be mutable; immutable if false. * * @return ParentAwareContainerInterface */ @@ -106,7 +106,7 @@ public function createBaseContainer() */ public function createDefinition($value) { - return function(ContainerInterface $container, $previous = null) use ($value) { + return function (ContainerInterface $container, $previous = null) use ($value) { return $value; }; } @@ -164,15 +164,15 @@ public function testOneLevelRetrieval() $rootContainer = $this->createInstance(); $childContainer1 = $this->createContainer( $this->createServiceProvider(array( - 'service1' => $this->createDefinition('service-1'), - 'service2' => $this->createDefinition('service-2'), + 'service1' => $this->createDefinition('service-1'), + 'service2' => $this->createDefinition('service-2'), )), // Servide definitions $rootContainer, // Parent false // Immutable ); $childContainer2 = $this->createContainer( $this->createServiceProvider(array( - 'service3' => $this->createDefinition('service-3'), + 'service3' => $this->createDefinition('service-3'), )), // Servide definitions $rootContainer, // Parent false // Immutable @@ -181,9 +181,9 @@ public function testOneLevelRetrieval() $rootContainer->add($childContainer2); $expected = array( - 'service1' => 'service-1', - 'service2' => 'service-2', - 'service3' => 'service-3', + 'service1' => 'service-1', + 'service2' => 'service-2', + 'service3' => 'service-3', ); $actual = array(); @@ -207,11 +207,12 @@ public function testTwoLevelRetrieval() $childContainer1 = $this->createContainer( $this->createServiceProvider(array( - 'service1' => function (ContainerInterface $container) use ($me) { + 'service1' => function (ContainerInterface $container) use ($me) { $me->assertInstanceOf('Dhii\Di\CompositeContainerInterface', $container, 'Container must be composite in order to retrieve definition from another container'); + return implode('->', array('service-1', $container->get('service3'))); }, - 'service2' => $this->createDefinition('service-2'), + 'service2' => $this->createDefinition('service-2'), )), // Servide definitions $rootContainer, // Parent false // Immutable @@ -220,7 +221,7 @@ public function testTwoLevelRetrieval() $childContainer2 = $this->createContainer( $this->createServiceProvider(array( - 'service3' => $this->createDefinition('service-3'), + 'service3' => $this->createDefinition('service-3'), )), // Servide definitions $rootContainer, // Parent false // Immutable @@ -232,9 +233,9 @@ public function testTwoLevelRetrieval() $this->assertEquals(2, count($rootContainer->getContainers()), 'Incorrect number of child containers'); $expected = array( - 'service1' => 'service-1->service-3', - 'service2' => 'service-2', - 'service3' => 'service-3', + 'service1' => 'service-1->service-3', + 'service2' => 'service-2', + 'service3' => 'service-3', ); $actual = array(); @@ -259,15 +260,17 @@ public function testThreeLevelComplexRetrieval() $rootContainer = $this->createInstance(); $childContainer1 = $this->createContainer( $this->createServiceProvider(array( - 'service1' => $this->createDefinition('service-1'), - 'service2' => function (ContainerInterface $c) use ($me) { + 'service1' => $this->createDefinition('service-1'), + 'service2' => function (ContainerInterface $c) use ($me) { $me->assertInstanceOf('Dhii\Di\CompositeContainerInterface', $c, 'Container must be composite in order to retrieve definition from another container'); + return implode('->', array('service-2', $c->get('service3'))); }, - 'service7' => function (ContainerInterface $c) use ($me) { + 'service7' => function (ContainerInterface $c) use ($me) { $me->assertInstanceOf('Dhii\Di\CompositeContainerInterface', $c, 'Container must be composite in order to retrieve definition from another container'); + return implode('->', array('service-7', $c->get('service4'))); - } + }, )), // Servide definitions $rootContainer, // Parent false // Immutable @@ -276,11 +279,12 @@ public function testThreeLevelComplexRetrieval() $childContainer2 = $this->createContainer( $this->createServiceProvider(array( - 'service3' => $this->createDefinition('service-3'), - 'service4' => function (ContainerInterface $c) use ($me) { + 'service3' => $this->createDefinition('service-3'), + 'service4' => function (ContainerInterface $c) use ($me) { $me->assertInstanceOf('Dhii\Di\CompositeContainerInterface', $c, 'Container must be composite in order to retrieve definition from another container'); + return implode('->', array('service-4', $c->get('service5'))); - } + }, )), // Servide definitions $rootContainer, // Parent false // Immutable @@ -291,25 +295,28 @@ public function testThreeLevelComplexRetrieval() $childContainer3 = $this->createInstance($rootContainer); $childContainer3->add($this->createContainer( $this->createServiceProvider(array( - 'service5' => function (ContainerInterface $c) use ($me) { + 'service5' => function (ContainerInterface $c) use ($me) { $me->assertInstanceOf('Dhii\Di\CompositeContainerInterface', $c, 'Container must be composite in order to retrieve definition from another container'); + return implode('->', array('service-5', $c->get('service8'))); }, - 'service6' => $this->createDefinition('service-6') + 'service6' => $this->createDefinition('service-6'), )), $rootContainer, false )); $childContainer3->add($this->createContainer( $this->createServiceProvider(array( - 'service8' => function (ContainerInterface $c) use ($me) { + 'service8' => function (ContainerInterface $c) use ($me) { $me->assertInstanceOf('Dhii\Di\CompositeContainerInterface', $c, 'Container must be composite in order to retrieve definition from another container'); + return implode('->', array('service-8', $c->get('service1'))); }, - 'service9' => function (ContainerInterface $c) use ($me) { + 'service9' => function (ContainerInterface $c) use ($me) { $me->assertInstanceOf('Dhii\Di\CompositeContainerInterface', $c, 'Container must be composite in order to retrieve definition from another container'); + return implode('->', array('service-9', $c->get('service6'))); - } + }, )), $rootContainer, false @@ -319,17 +326,16 @@ public function testThreeLevelComplexRetrieval() $rootContainer->add($childContainer2); $rootContainer->add($childContainer3); - $expected = array( - 'service1' => 'service-1', - 'service2' => 'service-2->service-3', - 'service3' => 'service-3', - 'service4' => 'service-4->service-5->service-8->service-1', - 'service5' => 'service-5->service-8->service-1', - 'service6' => 'service-6', - 'service7' => 'service-7->service-4->service-5->service-8->service-1', - 'service8' => 'service-8->service-1', - 'service9' => 'service-9->service-6' + 'service1' => 'service-1', + 'service2' => 'service-2->service-3', + 'service3' => 'service-3', + 'service4' => 'service-4->service-5->service-8->service-1', + 'service5' => 'service-5->service-8->service-1', + 'service6' => 'service-6', + 'service7' => 'service-7->service-4->service-5->service-8->service-1', + 'service8' => 'service-8->service-1', + 'service9' => 'service-9->service-6', ); $actual = array(); From c7af3c964f05d05689276a0812ec71096573e78a Mon Sep 17 00:00:00 2001 From: Miguel Muscat Date: Fri, 3 Feb 2017 12:05:17 +0100 Subject: [PATCH 13/20] Improved test for exception creation methods (#9) The test now checks using `assertInstanceof()` and separately checks the message, code and previous properties. --- test/functional/CompositeContainerTest.php | 24 ++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/test/functional/CompositeContainerTest.php b/test/functional/CompositeContainerTest.php index e8b4a2b..a42da7c 100644 --- a/test/functional/CompositeContainerTest.php +++ b/test/functional/CompositeContainerTest.php @@ -355,10 +355,16 @@ public function testCreateNotFoundException() { $subject = $this->createInstance(); - $expected = new NotFoundException('test message', 3, null); - $exception = $subject->this()->_createNotFoundException('test message', 3, null); + $previous = new \Exception('test message', 3, null); + $exception = $subject->this()->_createNotFoundException('test message', 3, $previous); - $this->assertEquals($expected, $exception); + $this->assertInstanceOf('Dhii\\Di\\Exception\\NotFoundException', $exception); + $this->assertInstanceOf('Dhii\\Di\\ExceptionInterface', $exception); + $this->assertInstanceOf('Interop\\Container\\Exception\\NotFoundException', $exception); + + $this->assertEquals('test message', $exception->getMessage()); + $this->assertEquals(3, $exception->getCode()); + $this->assertEquals($previous, $exception->getPrevious()); } /** @@ -370,9 +376,15 @@ public function testContainerException() { $subject = $this->createInstance(); - $expected = new ContainerException('test message', 3, null); - $exception = $subject->this()->_createContainerException('test message', 3, null); + $previous = new \Exception('test message', 3, null); + $exception = $subject->this()->_createContainerException('test message', 3, $previous); + + $this->assertInstanceOf('Dhii\\Di\\Exception\\ContainerException', $exception); + $this->assertInstanceOf('Dhii\\Di\\ExceptionInterface', $exception); + $this->assertInstanceOf('Interop\\Container\\Exception\\ContainerException', $exception); - $this->assertEquals($expected, $exception); + $this->assertEquals('test message', $exception->getMessage()); + $this->assertEquals(3, $exception->getCode()); + $this->assertEquals($previous, $exception->getPrevious()); } } From a9e1fa7551b4bd00eab9d46571d99ab8444540dc Mon Sep 17 00:00:00 2001 From: Anton Ukhanev Date: Fri, 3 Feb 2017 12:23:33 +0100 Subject: [PATCH 14/20] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54ef02b..c02b886 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,3 +18,4 @@ Reduced size of dist archive. ### Fixed - `CompositeContainer#__construct()` not accepting interop containers. - `CompositeContainer#add()` not implementing interface method. +- `CompositeContainer` not throwing exceptions correctly. From d46d79cd51745dc44b71b9365fabda27b4f12bad Mon Sep 17 00:00:00 2001 From: The Gitter Badger Date: Fri, 3 Feb 2017 11:28:02 +0000 Subject: [PATCH 15/20] Add Gitter badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4d8fdcb..50b6c34 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ ## Dhii - DI ## + +[![Join the chat at https://gitter.im/Dhii/di](https://badges.gitter.im/Dhii/di.svg)](https://gitter.im/Dhii/di?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://travis-ci.org/Dhii/di.svg?branch=master)](https://travis-ci.org/Dhii/di) [![Code Climate](https://codeclimate.com/github/Dhii/di/badges/gpa.svg)](https://codeclimate.com/github/Dhii/di) [![Test Coverage](https://codeclimate.com/github/Dhii/di/badges/coverage.svg)](https://codeclimate.com/github/Dhii/di/coverage) From 9d81ec3f0c72b8059dd1cad11ab24c9eb2a8e57d Mon Sep 17 00:00:00 2001 From: Anton Ukhanev Date: Fri, 3 Feb 2017 12:35:04 +0100 Subject: [PATCH 16/20] Replaced next version placeholders in tests --- test/functional/CompositeContainerTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/functional/CompositeContainerTest.php b/test/functional/CompositeContainerTest.php index 7a59a7a..625f1ff 100644 --- a/test/functional/CompositeContainerTest.php +++ b/test/functional/CompositeContainerTest.php @@ -349,7 +349,7 @@ public function testThreeLevelComplexRetrieval() /** * Tests the method that creates a {@see NotFoundException}. * - * @since [*next-version*] + * @since 0.1.1 */ public function testCreateNotFoundException() { @@ -370,7 +370,7 @@ public function testCreateNotFoundException() /** * Tests the method that creates a {@see ContainerException}. * - * @since [*next-version*] + * @since 0.1.1 */ public function testContainerException() { From c1a663476926436b1c347cb12b38755ef08b5d8e Mon Sep 17 00:00:00 2001 From: XedinUnknown Date: Fri, 3 Feb 2017 12:49:39 +0100 Subject: [PATCH 17/20] Added Gitter badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 50b6c34..3ec3663 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ ## Dhii - DI ## -[![Join the chat at https://gitter.im/Dhii/di](https://badges.gitter.im/Dhii/di.svg)](https://gitter.im/Dhii/di?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://travis-ci.org/Dhii/di.svg?branch=master)](https://travis-ci.org/Dhii/di) [![Code Climate](https://codeclimate.com/github/Dhii/di/badges/gpa.svg)](https://codeclimate.com/github/Dhii/di) [![Test Coverage](https://codeclimate.com/github/Dhii/di/badges/coverage.svg)](https://codeclimate.com/github/Dhii/di/coverage) +[![Join the chat at https://gitter.im/Dhii/di](https://badges.gitter.im/Dhii/di.svg)](https://gitter.im/Dhii/di?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) A simple, granular, standards-compliant dependency injection container and factory implementation. From cd5e5d130cf98f8e7ff84fc54084969fb97820d3 Mon Sep 17 00:00:00 2001 From: Anton Ukhanev Date: Fri, 3 Feb 2017 12:58:38 +0100 Subject: [PATCH 18/20] Added Gitter nofications to Travis config (#12) This fixes #12 --- .travis.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7555003..15fa52b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,4 +15,12 @@ script: - vendor/bin/phpunit after_script: - - vendor/bin/test-reporter --coverage-report="test/coverage/clover.xml" \ No newline at end of file + - vendor/bin/test-reporter --coverage-report="test/coverage/clover.xml" + +notifications: + webhooks: + urls: + - https://webhooks.gitter.im/e/155f53c8074ea0a9073e + on_success: always + on_failure: always + on_start: never From 2b8b5b009a3a78f6be4ee2331e145da8e5749628 Mon Sep 17 00:00:00 2001 From: Anton Ukhanev Date: Fri, 3 Feb 2017 14:08:06 +0100 Subject: [PATCH 19/20] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c02b886..113b2d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ Initial release, containing concrete implementations. ## [0.1.1] - 2017-02-03 Non-BC-breaking bugfixes. Reduced size of dist archive. +Added Gitter notifications of Travis events, and Gitter badge. ### Fixed - `CompositeContainer#__construct()` not accepting interop containers. From 4b996e683567504830a975ee3b4db79d8e296eb1 Mon Sep 17 00:00:00 2001 From: Anton Ukhanev Date: Fri, 3 Feb 2017 14:24:51 +0100 Subject: [PATCH 20/20] Fixed changelog releases order --- CHANGELOG.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 113b2d4..2953364 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,6 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## [0.1] - 2017-02-02 -Initial release, containing concrete implementations. - -### Added -- Implementations of regular and compound containers, with service provider support. -- Tests. - ## [0.1.1] - 2017-02-03 Non-BC-breaking bugfixes. Reduced size of dist archive. @@ -20,3 +13,10 @@ Added Gitter notifications of Travis events, and Gitter badge. - `CompositeContainer#__construct()` not accepting interop containers. - `CompositeContainer#add()` not implementing interface method. - `CompositeContainer` not throwing exceptions correctly. + +## [0.1] - 2017-02-02 +Initial release, containing concrete implementations. + +### Added +- Implementations of regular and compound containers, with service provider support. +- Tests.