From 4de774704c3a83d1bb3f1b5f2bbb116ac6ced315 Mon Sep 17 00:00:00 2001 From: Phil Bennett Date: Mon, 13 Aug 2018 11:41:41 +0100 Subject: [PATCH] 3.2.0 release --- CHANGELOG.md | 6 ++++++ docs/3.x/definitions.md | 10 ++++++++++ docs/_data/releases.yml | 2 +- docs/_includes/footer.html | 14 +++++++------- docs/_includes/head.html | 10 +++++----- src/Definition/Definition.php | 2 +- src/Definition/DefinitionInterface.php | 2 +- 7 files changed, 31 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97f4364..986b11a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All Notable changes to `League\Container` will be documented in this file +## 3.2.0 + +### Added +- Added ability to add definition as not shared when container is set to default to shared. +- Added `{set|get}Concrete` to definitions to allow for better use of `extend`. + ## 3.1.0 ### Added diff --git a/docs/3.x/definitions.md b/docs/3.x/definitions.md index f6b864b..58d59bd 100644 --- a/docs/3.x/definitions.md +++ b/docs/3.x/definitions.md @@ -186,6 +186,16 @@ $container = (new League\Container\Container)->defaultToShared(); $container->add(Acme\Foo::class); ~~~ +To define a definition not to be shared when the container is set to default to shared, we can reverse the functionality of defining it as shared. + +~~~ php +defaultToShared(); + +$container->add(Acme\Foo::class, Acme\Foo::class, $shared = false); +~~~ + If we have a definition marked as shared and we want to force the retrieval of a new instance, we can pass a second argument to Container on `get`. ~~~ php diff --git a/docs/_data/releases.yml b/docs/_data/releases.yml index d42d930..79b5e52 100644 --- a/docs/_data/releases.yml +++ b/docs/_data/releases.yml @@ -20,7 +20,7 @@ name: League\Container 3.x type: Current requires: PHP >= 7.0.0 - release: 3.1.0 - 2018-08 + release: 3.2.0 - 2018-08 support: Ongoing url: /3.x/ menu: diff --git a/docs/_includes/footer.html b/docs/_includes/footer.html index 29286a5..075abe6 100644 --- a/docs/_includes/footer.html +++ b/docs/_includes/footer.html @@ -46,10 +46,10 @@ - - - - - - - + + + + + + + diff --git a/docs/_includes/head.html b/docs/_includes/head.html index 975bf8e..e7f0bd5 100644 --- a/docs/_includes/head.html +++ b/docs/_includes/head.html @@ -2,9 +2,9 @@ {{ site.title }} - - - - - + + + + + diff --git a/src/Definition/Definition.php b/src/Definition/Definition.php index 6d8f908..567713d 100644 --- a/src/Definition/Definition.php +++ b/src/Definition/Definition.php @@ -127,7 +127,7 @@ public function getConcrete() /** * {@inheritdoc} */ - public function setConcrete($concrete): DefinitionInterface + public function setConcrete($concrete) : DefinitionInterface { $this->concrete = $concrete; diff --git a/src/Definition/DefinitionInterface.php b/src/Definition/DefinitionInterface.php index 7a54ab4..1f1e9e0 100644 --- a/src/Definition/DefinitionInterface.php +++ b/src/Definition/DefinitionInterface.php @@ -68,7 +68,7 @@ public function getConcrete(); * * @return DefinitionInterface */ - public function setConcrete($concrete): DefinitionInterface; + public function setConcrete($concrete) : DefinitionInterface; /** * Add an argument to be injected.