fabpot/Pimple — pull request #97 by gigr (2013-11-30 15:07:36+00:00)
Title: Allow setting protected and factory services inside the constructor.

Fixes the following scenario.

```php

class Foo extends Pimple
{
public function __construct()
{
parent::__construct([
// $this->protect(), while callable, does not have
// $this->protected initialized yet, so it blows up.
'bar' => $this->protect(function () {
return 'Hi, Fabien!';
}),
]);
}
}

$foo = new Foo(); // kersplode!
```

This has no effect when constructing a bare Pimple object, since you cannot call `protect()` without first fully instantiating the object.

```php
$pimple = new Pimple([
// $pimple->protect() is obviously not callable here since
// the object isn't fully constructed.
]);
```

I'm going to send another PR for fixing the documentation. The section about packaging a container for reusability is incorrect since it suggests that you do not need to call the parent constructor (you totally do in Pimple 2.0).