An extension to Symfony2 FrameworkBundle that adds annotation configuration for Controller classes
PHP HTML
Latest commit 1c66c2e Feb 15, 2017 @fabpot fabpot bug #460 Controller arguments with default values should be default o…
…ptional (chalasr)

This PR was merged into the 3.0 branch.

Discussion
----------

Controller arguments with default values should be default optional

This makes that for e.g:

```php
function fooAction($foo = null, Request $request);
```

the `$foo` parameter is considered optional.

Before it was relying on `ReflectionParameter::isOptional()` only, which returns false if the parameter is not the last. This additionally checks for `isDefaultValueAvailable()`.
To me it's a bug that was hidden by the fact request attributes were automatically created for any parameter with a default value, that has been fixed in symfony.

Fixes symfony/symfony#21563.

Commits
-------

8bd1da3 Controller arguments with default values should be optional

README.md

SensioFrameworkExtraBundle

This bundle provides a way to configure your controllers with annotations.

Read about it on its official homepage.

As of v3.0.0 of the bundle, the release cycle is de-synchronized from the framework's. It means you can just require "sensio/framework-extra-bundle": "~3.0" in your composer.json and Composer will automatically pick the latest version of the bundle that works with your current version of Symfony. The minimum version of Symfony for this workflow is 2.3.