fabpot/Pimple — pull request #115 by raphahardt (2014-03-24 15:50:04+00:00)
Title: added alias() feature

I added a functionality that acts as class_alias() function.
I think it's useful if you need to give another name to a service without create two (or more) copies.

Aliasing could be like this:

$pimple['bar'] = $pimple['foo'];

But this makes 'foo' to freeze and internally boots it, which is not desirable.
Or could be like this:

$pimple['bar'] = $pimple->raw('foo');

This does not freeze/boot 'foo', but seems ugly and makes just a copy of 'foo', so a future redefinition would break the reference.
With alias() method, identifiers will be truly aliased:

$pimple->alias('foo', 'bar');

Sorry if i possibly miss something, i tried to cover every use case of this feature.