[OptionsResolver] fix removing normalizers
[OptionsResolver] fix normalizer without corresponding option
[Routing] initialize the Route properties

They should normally be initialized anyway in the constructor. But when extending the Route (like in CMF) and using an ORM/ODM to persist them in the DB, the constructor is not called. Then a new property that is not saved like hostnamePattern stays null which in turn makes the RouteCompiler fails as it expects '' instead of null.
[travis-ci] Zend Garbage Collection only for PHP5.4
merged branch pborreli/gc_memory (PR #6063)

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

Commits
-------

d3d8ff4 [travis-ci] Zend Garbage Collection only for PHP5.4

Discussion
----------

[travis-ci] Zend Garbage Collection only for PHP5.4
merged branch Tobion/patch-6 (PR #6065)

This PR was merged into the master branch.

Commits
-------

e39b709 [Routing] initialize the Route properties

Discussion
----------

[Routing] initialize the Route properties

They should normally be initialized anyway in the constructor. But when extending the Route (like in CMF) and using an ORM/ODM to persist them in the DB, the constructor is not called. Then a new property that is not saved like hostnamePattern stays null which in turn makes the RouteCompiler fails as it expects '' instead of null.
Fixed docblocks
merged branch nomack84/fixed_docblocks (PR #6067)

This PR was merged into the master branch.

Commits
-------

c78b46f Fixed docblocks

Discussion
----------

Fixed docblocks
"Updated" the changelog according to stof feedback
Added ability to set controller result in the kernel.view event
merged branch ltouroumov/2.1 (PR #5885)

This PR was submitted for the 2.1 branch but it was merged into the master branch instead (closes #5885).

Commits
-------

efc22a8 [HttpKernel] Added ability to set controller result in the kernel.view event

Discussion
----------

[HttpKernel] Added ability to set controller result in the kernel.view event

Added the method `GetResponseForControllerResultEvent:setControllerResult(array $controllerResult)` to allow kernel.view events to inject data into the result.

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

by stof at 2012-11-01T13:48:51Z

new features canot be added in the 2.1 branch, which is a maintenance branch and so receives only bugfixes.

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

by fabpot at 2012-11-02T07:13:56Z

I'm not opposed to the change but can you share your use case with us?

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

by ltouroumov at 2012-11-02T07:55:55Z

I have custom annotations that allow controller methods to be invoked before the actions is run (`@BeforeFilter`) and after the action is run (`@ViewFilter`) and after the response is sent (`@ResponseFilter`).
The view filter allows to alter the controller result for example to inject parent entities into the template.

If you need more details I suppose I could post the code but I would have to ask the boss first.

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

by ltouroumov at 2012-11-02T07:57:53Z

Also I fixed the missing dollar sign in the [`6ffea1dc1cfa23844c6d90a1bfa9a282d1807a61`](https://github.com/ltouroumov/symfony/commit/6ffea1dc1cfa23844c6d90a1bfa9a282d1807a61) commit. But I can't seem to attach it to the pull request.

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

by henrikbjorn at 2012-11-02T08:12:20Z

Needs tests.

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

by ltouroumov at 2012-11-02T08:38:03Z

Is it really necessary to write a test for a simple setter ? I'm not opposed to testing, just looking for a justification. And should I create a new test case or is there one ?

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

by henrikbjorn at 2012-11-02T08:42:49Z

Since your code had a clear syntax error i think that a test is in order ;)

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

by ltouroumov at 2012-11-02T08:45:03Z

Can't argue with that !

Would putting it in `Symfony\Component\HttpKernel\Tests\EventListener\ControllerResponseTest` do the trick ?

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

by henrikbjorn at 2012-11-02T09:16:55Z

Sounds fair enough.

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

by ltouroumov at 2012-11-02T09:31:09Z

This tests covers my use case(s), but there might be others I didn't think of.

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

by ludekstepan at 2012-11-20T17:15:45Z

+1
Please merge into master, I have a use case for it, now I'm relying on a Reflection to set the private property, but that's really a dirty solution. The setter would be perfect!
tweaked previous merge
Try to make sure cookies get deleted from the TokenProvider when no longer in use
Add Route::hasOption() and Route::hasRequirement() methods.
merged branch Crell/route-requirements (PR #6098)

This PR was merged into the master branch.

Commits
-------

b930066 Add Route::hasOption() and Route::hasRequirement() methods.

Discussion
----------

Add Route::hasOption() and Route::hasRequirement() methods.

It seems odd that there's a hasDefault() method but not for options and requirements.  Drupal has logic that depends on the existence of a given requirement.  So let's add that.

I think I got the coding standards right the first time for once... :-)
merged branch Tobion/patch-1 (PR #5104)

This PR was merged into the master branch.

Commits
-------

e2a50ef [OptionsResolver] fix normalizer without corresponding option
5a53821 [OptionsResolver] fix removing normalizers

Discussion
----------

OptionsResolver: normalizer fix

setNormalizer() -> replace() -> all() would generate an error.

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

by bschussek at 2012-07-29T16:09:20Z

Thank you for the fix! Could you please add a test case?

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

by Tobion at 2012-07-30T15:42:26Z

There is another problem: setNormalizer() (without setting an option) -> all()
I suggest to simply ignore normalizers that have no corresponding option. Do you agree?

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

by Tobion at 2012-07-30T16:19:24Z

On the other hand, one could argue that a normalizer without option should also work like this:
```
$this->options->setNormalizer('foo', function (Options $options) {
        return '';
});
$this->assertEquals(array('foo' => ''), $this->options->all());
```

But when having a normalizer that wants a previous value as param, it does not work (because there is none).

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

by stof at 2012-07-30T16:30:34Z

@Tobion according to github, this need to be rebased

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

by bschussek at 2012-07-30T19:16:48Z

I guess setNormalizer() should check whether the option is set and fail otherwise. The second possibility, as you say, is to ignore them in all(). I'd prefer whatever is more efficient.

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

by bschussek at 2012-07-30T19:17:27Z

But setting a normalizer without setting an option, and having that option appear in the final options, does not make sense if you ask me.

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

by Tobion at 2012-07-30T21:23:46Z

Well it could make sense. If you want to override/normalize an option to a given value however it has been overloaded by others or just not overloaded at all. This is what normalizers do. I think its more consistent than the other solutions.
Raising exception in setNormalizer would make the Class dependent on the order you call the methods, e.g. `setNormalizer(); set()` would not work. But the other way round would be ok.
Ignoring some normalizers in `all` would be strange because they are there but not applied under some circumstances.

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

by Tobion at 2012-07-30T21:42:40Z

Added the fix. If you disagree tell me.

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

by bschussek at 2012-08-04T09:30:18Z

> Raising exception in setNormalizer would make the Class dependent on the order you call the methods, e.g. `setNormalizer(); set()` would not work. But the other way round would be ok.

I think this would be a better solution. I dislike if the normalizer magically adds an option that does not exist. This could hide implementation error, e.g. when a refactoring removes an option, but the normalizer is forgotten. Can you throw an exception in this case?

Should we find use cases that rely on this to work, we can soften the behavior and remove the exception.

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

by Tobion at 2012-08-04T15:02:51Z

Well, that would also make it impossible to set a normalizer for on optional option in OptionsResolver.
So `setOptional` + `setNormalizers` would throw an exception which sounds counter-intuitive. Are you sure about that?

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

by Tobion at 2012-08-17T11:47:58Z

ping @bschussek

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

by Tobion at 2012-10-07T22:31:44Z

@bschussek ping

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

by stof at 2012-10-13T18:04:30Z

@bschussek ping

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

by Tobion at 2012-11-08T09:55:15Z

@bschussek please let's get this finished.
[Validator] Refactored the GraphWalker into an implementation of the Visitor design pattern.

With this refactoring comes a decoupling of the validator from the structure of
the underlying metadata. This way it is possible for Drupal to use the validator
for validating their Entity API by using their own metadata layer, which is not
modeled as classes and properties/getter methods.
[DoctrineBridge] Adapted UniqueValidator to latest changes in the Validator
[Form] Adapted FormValidator to latest changes in the Validator
Handle case of static controller method and controllers using magic __call() method