I'm building an API and I would ask something about using namespaces on a Symfony2 controller.
Is there a real difference doing :
<?php
namespace My\APIBundle\Controller;
use FOS\RestBundle\Controller\Annotations\View,
FOS\RestBundle\Controller\Annotations\Post,
FOS\RestBundle\Controller\Annotations\Get;
use [...]
class MyRestController extends Controller {
[...]
/**
* @View()
* @Get()
*/
public function getAction(Thing $thing) {
return $thing;
}
/**
* @View()
* @Post()
*/
public function postAction() {
}
or doing
<?php
namespace My\APIBundle\Controller;
use FOS\RestBundle\Controller\Annotations as Rest;
use [...]
class MyRestController extends Controller {
[...]
/**
* @Rest\View()
* @Rest\Get()
*/
public function getAction(Thing $thing) {
return $thing;
}
/**
* @Rest\View()
* @Rest\Post()
*/
public function postAction() {
}
Would the alias load everything in the given namespace, losing perfs ? Or will it load only annoted classes, unitary ?