remove extra verb
merged branch cordoval/patch-1 (PR #53)

This PR was merged into the master branch.

Commits
-------

584e413 remove extra verb

Discussion
----------

remove extra verb
Initialize property for serializers

Serializers and test frameworks skip the constructor using
serialization tricks. This means that if an empty Pimple instance is
serialized and later deserialized that the $values property contains
'null'. This breaks offsetExists() and several other locations that 
assume the $values property contains an array.
updated license year
Fixed Extend documentation
merged branch lyrixx/patch-1 (PR #58)

This PR was merged into the master branch.

Commits
-------

72837a4 Fixed Extend documentation

Discussion
----------

Fixed Extend documentation

---------------------------------------------------------------------------

by igorw at 2013-01-06T14:57:41Z

:+1:

---------------------------------------------------------------------------

by lyrixx at 2013-01-06T14:59:48Z

@igorw you are faster than @stof !!!

@fabpot After the merge, can you update the website ? Thanks?

---------------------------------------------------------------------------

by stof at 2013-01-06T16:57:55Z

@lyrixx do I have the permission to have a lfe outside github ?

---------------------------------------------------------------------------

by lyrixx at 2013-01-06T20:06:14Z

@stof Yes, of course :)
added Travis configuration
Introduce static versions of share() and protect()
merged branch igorw/static-share-protect (PR #63)

This PR was squashed before being merged into the master branch (closes #63).

Commits
-------

f3e834d Introduce static versions of share() and protect()

Discussion
----------

Introduce static versions of share() and protect()

I have a use case where I want to be able to pass parameters to an object that will then at some point create and initialize a pimple container. Then set the parameters. I want to be able to override defaults, including services.

Essentially, this:

    createContainer([
        'foo' => Pimple::shareStatic(function () { return new Foo(); }),
    ]);

Since the container does not exist yet, I have no instance to call share() on. Therefore, I want static versions of share and protect, so that this use case is supported properly.

I'm open to:

* Removing the docblocks on the static versions
* Finding better names for the static versions
* Just making the existing `share` and `protect` methods static and abuse the fact that PHP allows them to be called dynamically as well

---------------------------------------------------------------------------

by fabpot at 2013-02-09T10:54:00Z

Option 3 seems better to me (just making the current methods static).

---------------------------------------------------------------------------

by simensen at 2013-02-09T15:19:18Z

:+1:

Option 3 is my favorite as well.

---------------------------------------------------------------------------

by igorw at 2013-02-09T15:20:50Z

In that case I sincerely hope that PHP does not decide to deprecate that in the future. Updating PR.

---------------------------------------------------------------------------

by igorw at 2013-02-09T15:23:31Z

Done, changed to option 3.
Change  Visibility to be protected
merged branch ArabCoders/master (PR #66)

This PR was squashed before being merged into the master branch (closes #66).

Commits
-------

afece3c Change  Visibility to be protected

Discussion
----------

Change $values Visibility to be protected

This change allow other classes to extend Pimple and override some core class function.

EDIT: change public to protected

---------------------------------------------------------------------------

by stof at 2013-02-14T08:26:41Z

Why public ? It make no sense to have it public as some work needs to be done when accessing the values.

---------------------------------------------------------------------------

by ArabCoders at 2013-02-14T09:35:35Z

Hi
@stof,

it does make sense when you want to override(ie: overload) function take the following example

````php
class diDebug extends \Pimple
{
    public function offsetGet($id)
    {
        if (!array_key_exists($id, $this->values)) {
            throw new InvalidArgumentException(sprintf('Identifier "%s" is not defined.<BR />%s', $id, $this->get_backtrace() ));
        }

        $isFactory = is_object($this->values[$id]) && method_exists($this->values[$id], '__invoke');

        return $isFactory ? $this->values[$id]($this) : $this->values[$id];
    }

    public function raw($id)
    {
        if (!array_key_exists($id, $this->values)) {
            throw new InvalidArgumentException(sprintf('Identifier "%s" is not defined.<BR /> %s', $id, $this->get_backtrace() ));
        }

        return $this->values[$id];
    }
}
````

this example will not work because pimple::$values is set to private, and i dont think its reasonable to expect every call to the dependency injection class to be in try {} catch{} block

---------------------------------------------------------------------------

by fabpot at 2013-02-14T09:37:51Z

protected would be enough.

---------------------------------------------------------------------------

by stof at 2013-02-14T09:40:02Z

@ArabCoders thus, why do you need to include the backtrace in the exception message ? Enable XDebug and the trace will be displayed when an exception occurs.

---------------------------------------------------------------------------

by ArabCoders at 2013-02-14T09:43:22Z

@fabpot, indeed that will works too, i can send another pull request if you want.

@stof that's because most shared hosts dont have xdebug enabled or even compiled, and I have to debug manually.

---------------------------------------------------------------------------

by stof at 2013-02-14T09:45:06Z

are you developing directly on your hosting ?

---------------------------------------------------------------------------

by whatthejeff at 2013-02-14T09:48:27Z

Why not just do this:

```php
class diDebug extends \Pimple
{
    public function offsetGet($id)
    {
        try {
           return parent::offsetGet($id);
        } catch (Exception $exception) {
           // do whatever
        }
    }
}

---------------------------------------------------------------------------

by ArabCoders at 2013-02-14T09:53:35Z

@stof No, Im trying to debug client framework, and i run into this issue the other developer didn't follow any logical patterns, or test environment and the website is huge to be copied over to my test server. to replicate the problem so i had to make do with what is other developer had at that time and invent some hacks to make it work.

Anyway its not about me, i just think $values should be either public or protected so that other classes can extend it without any problems. ^^

---------------------------------------------------------------------------

by ArabCoders at 2013-02-14T09:59:10Z

@whatthejeff Yes it can be done that way too, i only showed an example for use case to make $values [public/protected] not necessarily the only example ^^

---------------------------------------------------------------------------

by stof at 2013-02-14T10:00:47Z

@ArabCoders Making it public means that it is part of the public API. But this is wrong. People should not be able to access the internal storage from the outside.

---------------------------------------------------------------------------

by ArabCoders at 2013-02-14T10:05:35Z

@stof yeah i realized that, that's why i asked if @fabpot wanted me to do another pull request with protected or he would do it :) im kinda new to the whole fork/pull thing.

PS: English is not my first tongue, so forgive any grammar mistakes
merged branch mvriel/patch-1 (PR #56)

This PR was merged into the master branch.

Commits
-------

53ec09c Initialize property for serializers

Discussion
----------

Initialize property for serializers

Serializers and test frameworks skip the constructor using
serialization tricks. This means that if an empty Pimple instance is
serialized and later deserialized that the $values property contains
'null'. This breaks offsetExists() and several other locations that
assume the $values property contains an array.

---------------------------------------------------------------------------

by igorw at 2012-12-18T01:36:38Z

Serializing a pimple instance? Sounds scary.

Btw, see also #54 which is a superset of this PR.

---------------------------------------------------------------------------

by stof at 2012-12-18T10:01:06Z

Yeah, Pimple is meant to contain closures so serializing it sounds really scary

---------------------------------------------------------------------------

by mvriel at 2012-12-18T10:36:20Z

Apparently PHPUnit does it since all my unit tests fail unless I add that initializer. Perhaps I can tweak a setting in PHPUnit to resolve this but haven't had time to dive into which option that should be

---------------------------------------------------------------------------

by SergSerbin at 2012-12-18T11:36:12Z

For PHPUnit you should be able to solve it with adding  ` @backupGlobals disabled` to the phpDoc of a test method (or test class) definition.
http://www.phpunit.de/manual/current/en/appendixes.annotations.html

---------------------------------------------------------------------------

by igorw at 2013-01-13T20:58:09Z

My PR which included this change was closed. @fabpot This PR should be merged.