Skip to content

stop using the deprecated @method annotation #10150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions quick_tour/the_controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ as its default value::

// src/AppBundle/Controller/DefaultController.php
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

// ...

Expand Down Expand Up @@ -154,7 +153,6 @@ option of the ``@Route()`` annotation::

// src/AppBundle/Controller/DefaultController.php
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

// ...

Expand Down
2 changes: 1 addition & 1 deletion routing/custom_route_loader.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Loading Routes
The routes in a Symfony application are loaded by the
:class:`Symfony\\Bundle\\FrameworkBundle\\Routing\\DelegatingLoader`.
This loader uses several other loaders (delegates) to load resources of
different types, for instance YAML files or ``@Route`` and ``@Method`` annotations
different types, for instance YAML files or ``@Route`` annotations
in controller files. The specialized loaders implement
:class:`Symfony\\Component\\Config\\Loader\\LoaderInterface`
and therefore have two important methods:
Expand Down
7 changes: 2 additions & 5 deletions routing/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,23 +187,20 @@ accomplished with the following route configuration:
// src/AppBundle/Controller/BlogApiController.php
namespace AppBundle\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
// ...

class BlogApiController extends Controller
{
/**
* @Route("/api/posts/{id}")
* @Method({"GET","HEAD"})
* @Route("/api/posts/{id}", methods={"GET","HEAD"})
*/
public function showAction($id)
{
// ... return a JSON response with the post
}

/**
* @Route("/api/posts/{id}")
* @Method("PUT")
* @Route("/api/posts/{id}", methods={"PUT"})
*/
public function editAction($id)
{
Expand Down
11 changes: 3 additions & 8 deletions service_container/autowiring.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ Here is a typical controller using the ``twitter_client`` service::
namespace Acme\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
Expand All @@ -115,8 +114,7 @@ Here is a typical controller using the ``twitter_client`` service::
class DefaultController extends Controller
{
/**
* @Route("/tweet")
* @Method("POST")
* @Route("/tweet", methods={"POST"})
*/
public function tweetAction(Request $request)
{
Expand Down Expand Up @@ -259,7 +257,6 @@ transformer::
namespace Acme\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
Expand All @@ -268,17 +265,15 @@ transformer::
class DefaultController extends Controller
{
/**
* @Route("/tweet")
* @Method("POST")
* @Route("/tweet", methods={"POST"})
*/
public function tweetAction(Request $request)
{
return $this->tweet($request, 'twitter_client');
}

/**
* @Route("/tweet-uppercase")
* @Method("POST")
* @Route("/tweet-uppercase", methods={"POST"})
*/
public function tweetUppercaseAction(Request $request)
{
Expand Down