From 6283116728a901e9f0c54423693458a3ba616b35 Mon Sep 17 00:00:00 2001 From: Valentin Date: Sat, 2 Dec 2017 23:49:44 +0300 Subject: [PATCH] Follow the same code style in docblock annotations --- best_practices/business-logic.rst | 2 +- best_practices/controllers.rst | 6 +++--- reference/constraints/All.rst | 2 +- reference/constraints/Choice.rst | 6 +++--- reference/constraints/IsTrue.rst | 2 +- reference/constraints/Luhn.rst | 2 +- reference/constraints/Valid.rst | 4 ++-- routing.rst | 4 ++-- routing/optional_placeholders.rst | 2 +- routing/requirements.rst | 6 +++--- templating/formats.rst | 2 +- validation.rst | 2 +- validation/severity.rst | 6 +++--- validation/translations.rst | 2 +- 14 files changed, 24 insertions(+), 24 deletions(-) diff --git a/best_practices/business-logic.rst b/best_practices/business-logic.rst index ec499bb02d9..3fe88fa41b6 100644 --- a/best_practices/business-logic.rst +++ b/best_practices/business-logic.rst @@ -257,7 +257,7 @@ looking for mapping information: * mappedBy="post", * orphanRemoval=true * ) - * @ORM\OrderBy({"publishedAt" = "ASC"}) + * @ORM\OrderBy({"publishedAt"="ASC"}) */ private $comments; diff --git a/best_practices/controllers.rst b/best_practices/controllers.rst index 78d589eb3cb..ef4f40d417d 100644 --- a/best_practices/controllers.rst +++ b/best_practices/controllers.rst @@ -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) { @@ -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) { diff --git a/reference/constraints/All.rst b/reference/constraints/All.rst index 14b53c35cf8..d3116fd4e51 100644 --- a/reference/constraints/All.rst +++ b/reference/constraints/All.rst @@ -35,7 +35,7 @@ entry in that array: /** * @Assert\All({ * @Assert\NotBlank, - * @Assert\Length(min = 5) + * @Assert\Length(min=5) * }) */ protected $favoriteColors = array(); diff --git a/reference/constraints/Choice.rst b/reference/constraints/Choice.rst index 1c412bdd783..57b82e1f0aa 100644 --- a/reference/constraints/Choice.rst +++ b/reference/constraints/Choice.rst @@ -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; } @@ -159,7 +159,7 @@ constraint. class Author { /** - * @Assert\Choice(callback = "getGenres") + * @Assert\Choice(callback="getGenres") */ protected $genre; } @@ -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; } diff --git a/reference/constraints/IsTrue.rst b/reference/constraints/IsTrue.rst index 526f68a9093..5cf197c30d9 100644 --- a/reference/constraints/IsTrue.rst +++ b/reference/constraints/IsTrue.rst @@ -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() { diff --git a/reference/constraints/Luhn.rst b/reference/constraints/Luhn.rst index 89975e73ca6..fe9c09d8407 100644 --- a/reference/constraints/Luhn.rst +++ b/reference/constraints/Luhn.rst @@ -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; } diff --git a/reference/constraints/Valid.rst b/reference/constraints/Valid.rst index 67ec4bc86a6..3e3c8d70ba9 100644 --- a/reference/constraints/Valid.rst +++ b/reference/constraints/Valid.rst @@ -65,7 +65,7 @@ stores an ``Address`` instance in the ``$address`` property. /** * @Assert\NotBlank - * @Assert\Length(max = 5) + * @Assert\Length(max=5) */ protected $zipCode; } @@ -79,7 +79,7 @@ stores an ``Address`` instance in the ``$address`` property. { /** * @Assert\NotBlank - * @Assert\Length(min = 4) + * @Assert\Length(min=4) */ protected $firstName; diff --git a/routing.rst b/routing.rst index 5b7a926748b..3f64ab5ca32 100644 --- a/routing.rst +++ b/routing.rst @@ -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) { @@ -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) { diff --git a/routing/optional_placeholders.rst b/routing/optional_placeholders.rst index 358ae67ef15..4d8b0a11a34 100644 --- a/routing/optional_placeholders.rst +++ b/routing/optional_placeholders.rst @@ -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) { diff --git a/routing/requirements.rst b/routing/requirements.rst index 7267e962c62..c835a636e4d 100644 --- a/routing/requirements.rst +++ b/routing/requirements.rst @@ -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) { @@ -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) diff --git a/templating/formats.rst b/templating/formats.rst index 2c9ec990e27..d272d2b4b0b 100644 --- a/templating/formats.rst +++ b/templating/formats.rst @@ -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) { diff --git a/validation.rst b/validation.rst index 1d809bcdb0c..7431ac6ba70 100644 --- a/validation.rst +++ b/validation.rst @@ -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() { diff --git a/validation/severity.rst b/validation/severity.rst index 865e5ce6399..9f3142eb8e4 100644 --- a/validation/severity.rst +++ b/validation/severity.rst @@ -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; } diff --git a/validation/translations.rst b/validation/translations.rst index fd976c4a6d3..c720945ef37 100644 --- a/validation/translations.rst +++ b/validation/translations.rst @@ -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; }