Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 78939ae

Browse files
committed
Merge branch 'feature/498-pimple-docs' into release-3.0.0
Close #498
2 parents a944ead + e429703 commit 78939ae

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ can recommend the following implementations:
7373

7474
- [zend-servicemanager](https://github.com/zendframework/zend-servicemanager):
7575
`composer require zendframework/zend-servicemanager`
76-
- [pimple-container-interop](https://github.com/xtreamwayz/pimple-container-interop):
77-
`composer require xtreamwayz/pimple-container-interop`
76+
- [Pimple](https://github.com/silexphp/Pimple):
77+
`composer require pimple/pimple`
7878
- [Aura.Di](https://github.com/auraphp/Aura.Di):
7979
`composer require aura/di`
8080

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"filp/whoops": "^2.1 to use the Whoops error handler",
5151
"zendframework/zend-expressive-helpers": "^3.0 for its UrlHelper, ServerUrlHelper, and BodyParseMiddleware",
5252
"aura/di": "^3.2 to make use of Aura.Di dependency injection container",
53-
"xtreamwayz/pimple-container-interop": "^1.0 to use Pimple for dependency injection",
53+
"pimple/pimple": "^3.2.2 to use Pimple for dependency injection",
5454
"zendframework/zend-expressive-tooling": "For migration and development tools; require it with the --dev flag",
5555
"zendframework/zend-servicemanager": "^3.3 to use zend-servicemanager for dependency injection"
5656
},

docs/book/features/container/pimple.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,11 @@ Pimple only supports programmatic creation at this time.
1212

1313
## Installing Pimple
1414

15-
Pimple does not currently (as of v3) implement
16-
[PSR-11 Container](https://github.com/php-fig/container); as
17-
such, you need to install the `xtreamwayz/pimple-container-interop` project,
18-
which provides a [PSR-11 Container](https://github.com/php-fig/container)
19-
wrapper around Pimple v3:
15+
Pimple implements [PSR-11 Container](https://github.com/php-fig/container)
16+
as of version 3.2.
2017

2118
```bash
22-
$ composer require xtreamwayz/pimple-container-interop
19+
$ composer require pimple/pimple
2320
```
2421

2522
## Configuring Pimple
@@ -29,13 +26,14 @@ recommend doing this in a dedicated script that returns the Pimple instance; in
2926
this example, we'll have that in `config/container.php`.
3027

3128
```php
32-
use Xtreamwayz\Pimple\Container as Pimple;
29+
use Pimple\Container as PimpleContainer;
30+
use Pimple\Psr11\Container as PsrContainer;
3331
use Zend\Expressive\Container;
3432
use Zend\Expressive\Plates\PlatesRenderer;
3533
use Zend\Expressive\Router;
3634
use Zend\Expressive\Template\TemplateRendererInterface;
3735

38-
$container = new Pimple();
36+
$container = new PimpleContainer();
3937

4038
// Application and configuration
4139
$container['config'] = include 'config/config.php';
@@ -44,7 +42,7 @@ $container['Zend\Expressive\Application'] = new Container\ApplicationFactory;
4442
// Routing
4543
// In most cases, you can instantiate the router you want to use without using a
4644
// factory:
47-
$container['Zend\Expressive\Router\RouterInterface'] = function ($container) {
45+
$container['Zend\Expressive\Router\RouterInterface'] = function (PimpleContainer $container) {
4846
return new Router\Aura();
4947
};
5048

@@ -59,7 +57,7 @@ $container[Zend\Expressive\Middleware\NotFoundHandler::class] = new Container\No
5957
// Templating
6058
// In most cases, you can instantiate the template renderer you want to use
6159
// without using a factory:
62-
$container[TemplateRendererInterface::class] = function ($container) {
60+
$container[TemplateRendererInterface::class] = function (PimpleContainer $container) {
6361
return new PlatesRenderer();
6462
};
6563

@@ -88,7 +86,7 @@ $container['Zend\Expressive\FinalHandler'] = new Container\TemplatedErrorHandler
8886
// - Expressive 2.X:
8987
$container[Zend\Expressive\Middleware\ErrorResponseGenerator::class] = new Container\ErrorResponseGeneratorFactory();
9088

91-
return $container;
89+
return new PsrContainer($container);
9290
```
9391

9492
Your bootstrap (typically `public/index.php`) will then look like this:

0 commit comments

Comments
 (0)