Skip to content

Follow the same code style in docblock annotations #8815

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

Closed
wants to merge 1 commit into from
Closed
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: 1 addition & 1 deletion best_practices/business-logic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ looking for mapping information:
* mappedBy="post",
* orphanRemoval=true
* )
* @ORM\OrderBy({"publishedAt" = "ASC"})
* @ORM\OrderBy({"publishedAt"="ASC"})
*/
private $comments;

Expand Down
6 changes: 3 additions & 3 deletions best_practices/controllers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ manually. In our application, we have this situation in ``CommentController``:
.. code-block:: php

/**
* @Route("/comment/{postSlug}/new", name = "comment_new")
* @Route("/comment/{postSlug}/new", name="comment_new")
*/
public function newAction(Request $request, $postSlug)
{
Expand All @@ -192,8 +192,8 @@ flexible:
use Symfony\Component\HttpFoundation\Request;

/**
* @Route("/comment/{postSlug}/new", name = "comment_new")
* @ParamConverter("post", options={"mapping": {"postSlug": "slug"}})
* @Route("/comment/{postSlug}/new", name="comment_new")
* @ParamConverter("post", options={"mapping"={"postSlug"="slug"}})
*/
public function newAction(Request $request, Post $post)
{
Expand Down
2 changes: 1 addition & 1 deletion reference/constraints/All.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ entry in that array:
/**
* @Assert\All({
* @Assert\NotBlank,
* @Assert\Length(min = 5)
* @Assert\Length(min=5)
* })
*/
protected $favoriteColors = array();
Expand Down
6 changes: 3 additions & 3 deletions reference/constraints/Choice.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ If your valid choice list is simple, you can pass them in directly via the
protected $city;

/**
* @Assert\Choice(choices = {"fiction", "non-fiction"}, message = "Choose a valid genre.")
* @Assert\Choice(choices={"fiction", "non-fiction"}, message="Choose a valid genre.")
*/
protected $genre;
}
Expand Down Expand Up @@ -159,7 +159,7 @@ constraint.
class Author
{
/**
* @Assert\Choice(callback = "getGenres")
* @Assert\Choice(callback="getGenres")
*/
protected $genre;
}
Expand Down Expand Up @@ -224,7 +224,7 @@ you can pass the class name and the method as an array.
class Author
{
/**
* @Assert\Choice(callback = {"Util", "getGenres"})
* @Assert\Choice(callback={"Util", "getGenres"})
*/
protected $genre;
}
Expand Down
2 changes: 1 addition & 1 deletion reference/constraints/IsTrue.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Then you can constrain this method with ``IsTrue``.
protected $token;

/**
* @Assert\IsTrue(message = "The token is invalid")
* @Assert\IsTrue(message="The token is invalid")
*/
public function isTokenValid()
{
Expand Down
2 changes: 1 addition & 1 deletion reference/constraints/Luhn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ will contain a credit card number.
class Transaction
{
/**
* @Assert\Luhn(message = "Please check your credit card number.")
* @Assert\Luhn(message="Please check your credit card number.")
*/
protected $cardNumber;
}
Expand Down
4 changes: 2 additions & 2 deletions reference/constraints/Valid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ stores an ``Address`` instance in the ``$address`` property.

/**
* @Assert\NotBlank
* @Assert\Length(max = 5)
* @Assert\Length(max=5)
*/
protected $zipCode;
}
Expand All @@ -79,7 +79,7 @@ stores an ``Address`` instance in the ``$address`` property.
{
/**
* @Assert\NotBlank
* @Assert\Length(min = 4)
* @Assert\Length(min=4)
*/
protected $firstName;

Expand Down
4 changes: 2 additions & 2 deletions routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ To fix this, add a *requirement* that the ``{page}`` wildcard can *only* match n
class BlogController extends Controller
{
/**
* @Route("/blog/{page}", name="blog_list", requirements={"page": "\d+"})
* @Route("/blog/{page}", name="blog_list", requirements={"page"="\d+"})
*/
public function listAction($page)
{
Expand Down Expand Up @@ -277,7 +277,7 @@ So how can you make ``blog_list`` once again match when the user visits
class BlogController extends Controller
{
/**
* @Route("/blog/{page}", name="blog_list", requirements={"page": "\d+"})
* @Route("/blog/{page}", name="blog_list", requirements={"page"="\d+"})
*/
public function listAction($page = 1)
{
Expand Down
2 changes: 1 addition & 1 deletion routing/optional_placeholders.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ This is done by including it in the ``defaults`` collection:
// ...

/**
* @Route("/blog/{page}", defaults={"page" = 1})
* @Route("/blog/{page}", defaults={"page"=1})
*/
public function indexAction($page)
{
Expand Down
6 changes: 3 additions & 3 deletions routing/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ a routing ``{wildcard}`` to only match some regular expression:
class BlogController extends Controller
{
/**
* @Route("/blog/{page}", name="blog_list", requirements={"page": "\d+"})
* @Route("/blog/{page}", name="blog_list", requirements={"page"="\d+"})
*/
public function listAction($page)
{
Expand Down Expand Up @@ -97,8 +97,8 @@ URL:
class MainController extends Controller
{
/**
* @Route("/{_locale}", defaults={"_locale": "en"}, requirements={
* "_locale": "en|fr"
* @Route("/{_locale}", defaults={"_locale"="en"}, requirements={
* "_locale"="en|fr"
* })
*/
public function homepageAction($_locale)
Expand Down
2 changes: 1 addition & 1 deletion templating/formats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ be configured so that ``/about-us`` sets the request format to ``html`` while
special ``_format`` placeholder in your route definition::

/**
* @Route("/{slug}.{_format}", defaults={"_format": "html"})
* @Route("/{slug}.{_format}", defaults={"_format"="html"})
*/
public function showAction(Request $request, $slug)
{
Expand Down
2 changes: 1 addition & 1 deletion validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ this method must return ``true``:
class Author
{
/**
* @Assert\IsTrue(message = "The password cannot match your first name")
* @Assert\IsTrue(message="The password cannot match your first name")
*/
public function isPasswordLegal()
{
Expand Down
6 changes: 3 additions & 3 deletions validation/severity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ Use the ``payload`` option to configure the error level for each constraint:
class User
{
/**
* @Assert\NotBlank(payload = {"severity" = "error"})
* @Assert\NotBlank(payload={"severity"="error"})
*/
protected $username;

/**
* @Assert\NotBlank(payload = {"severity" = "error"})
* @Assert\NotBlank(payload={"severity"="error"})
*/
protected $password;

/**
* @Assert\Iban(payload = {"severity" = "warning"})
* @Assert\Iban(payload={"severity"="warning"})
*/
protected $bankAccountNumber;
}
Expand Down
2 changes: 1 addition & 1 deletion validation/translations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ property is not empty, add the following:
class Author
{
/**
* @Assert\NotBlank(message = "author.name.not_blank")
* @Assert\NotBlank(message="author.name.not_blank")
*/
public $name;
}
Expand Down