Fixed bug with multiple annotations in controller action.
Fixed class name detection for compability with JMSDiExtraBundle.
Added tests for multiple Cache annotations.
Merge branch 'master' of git://github.com/sensio/SensioFrameworkExtraBundle
removed unused classes from use
used  Doctrine ClassUtils instead of CG ClassUtils
replace usage of the CG ClassUtils with the Doctrine Common one
merged branch zerkalica/master (PR #149)

Commits
-------

448665a used  Doctrine ClassUtils instead of CG ClassUtils
ad5e3b4 removed unused classes from use
c5a08d9 Merge branch 'master' of git://github.com/sensio/SensioFrameworkExtraBundle
62ea2b9 Fixed bug with multiple annotations in controller action. Fixed class name detection for compability with JMSDiExtraBundle. Added tests for multiple Cache annotations.

Discussion
----------

Fixed bug with multiple annotations

In this example, first ParamConverter annotation not used.
```
/*
 * @ParamConverter("contract", class="MillwrightContractBundle:Contract", options={"id" = "contract"})
 * @ParamConverter("media", class="MillwrightUploadBundle:Media", options={"id" = "media"})
 */
 public function deleteFileAction(ContractInterface $contract, MediaInterface $media)
 {
     ...
 }
```
Problem in Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener::onKernelController

$request->attributes->set() rewrites first loaded configuration annotation with same alias.

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

by fabpot at 2012-07-27T09:58:45Z

Can you add some tests?

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

by schmittjoh at 2012-07-27T10:02:52Z

Could you please add/replace the following lines:

```
$className = get_class($controller[0]);
if (class_exists('CG\Core\ClassUtils')) {
    $className = \CG\Core\ClassUtils::getUserClass($className);
}
$ref = new \ReflectionClass($className);
// remove: $ref = new \ReflectionObject($controller[0]);
```

Then, we do not need to duplicate the code of this listener in JMSDiExtraBundle; see https://github.com/schmittjoh/JMSDiExtraBundle/pull/40 for reference.

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

by zerkalica at 2012-07-27T10:26:13Z

Adding this lines does not help, because DiExtraBundle fully replaces Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener

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

by schmittjoh at 2012-07-27T10:28:37Z

Yeah, but we can remove this class from JMSDiExtraBundle then.

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

by zerkalica at 2012-07-27T13:23:13Z

How i can run phpunit tests in SensioFrameworkExtraBundle, there is no vendors directory or autoload.php. I try to use  composer-generated autoload.php in vendors, but got a error:

```
Sensio\Bundle\FrameworkExtraBundle\Tests\EventListener\ControllerListenerTest::testCacheAnnotationAtMethod
Doctrine\Common\Annotations\AnnotationException: [Semantical Error] The annotation "@Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache" in method Sensio\Bundle\FrameworkExtraBundle\Tests\EventListener\Fixture\FooControllerCacheAtMethod::barAction() does not exist, or could not be auto-loaded.
```

But Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache autoloaded fine, I can create an instance.

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

by fabpot at 2012-07-27T14:53:23Z

@zerkalica

    composer.phar install --dev
    phpunit

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

by zerkalica at 2012-07-27T15:09:22Z

composer can't download bundles. Some trouble with version number.

```
composer.phar install --dev
Installing dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package symfony/framework-bundle 2.1.* could not be found.
```

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

by fabpot at 2012-07-28T06:19:55Z

I've just fixed that. It should work fine now.

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

by beberlei at 2012-07-28T14:45:57Z

Why use CG\ ClassUtils instead of the Doctrine ones? CG is not a dependency of FrameworkExtraBundle - Common is!

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

by zerkalica at 2012-07-28T19:20:49Z

I found 3 classes with same functionality:

CG\Core\ClassUtils
Doctrine\Common\Util\ClassUtils
Symfony\Component\Security\Core\Util\ClassUtils

Can you make an agreement ?

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

by schmittjoh at 2012-07-28T19:38:32Z

It does not really matter, should work with any of them. I suggested CG\
because it is already used in the other listener of this bundle.

On Sat, Jul 28, 2012 at 9:20 PM, zerkalica <
reply@reply.github.com
> wrote:

> I found 3 classes with same functionality:
>
> CG\Core\ClassUtils
> Doctrine\Common\Util\ClassUtils
> Symfony\Component\Security\Core\Util\ClassUtils
>
> Can you make an agreement ?
>
> ---
> Reply to this email directly or view it on GitHub:
>
> https://github.com/sensio/SensioFrameworkExtraBundle/pull/149#issuecomment-7336555
>

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

by fabpot at 2012-07-29T09:15:01Z

@zerkalica Doctrine\Common\Util\ClassUtils

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

by zerkalica at 2012-07-30T06:54:12Z

My PR ready to merging.

@schmittjoh I updated the commit and removed ControllerListener from JMSDiExtraBundle https://github.com/schmittjoh/JMSDiExtraBundle/pull/40
tweaked previous merge