Skip to content

Commit c27356b

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: doc(http_foundation.rst): Fix code error which used create() instead of constructor method. Follow the same code style in docblock annotations
2 parents 0c9f835 + 4787f7c commit c27356b

File tree

15 files changed

+25
-25
lines changed

15 files changed

+25
-25
lines changed

best_practices/business-logic.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ looking for mapping information:
257257
* mappedBy="post",
258258
* orphanRemoval=true
259259
* )
260-
* @ORM\OrderBy({"publishedAt" = "ASC"})
260+
* @ORM\OrderBy({"publishedAt"="ASC"})
261261
*/
262262
private $comments;
263263

best_practices/controllers.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ manually. In our application, we have this situation in ``CommentController``:
166166
.. code-block:: php
167167
168168
/**
169-
* @Route("/comment/{postSlug}/new", name = "comment_new")
169+
* @Route("/comment/{postSlug}/new", name="comment_new")
170170
*/
171171
public function newAction(Request $request, $postSlug)
172172
{
@@ -192,8 +192,8 @@ flexible:
192192
use Symfony\Component\HttpFoundation\Request;
193193
194194
/**
195-
* @Route("/comment/{postSlug}/new", name = "comment_new")
196-
* @ParamConverter("post", options={"mapping": {"postSlug": "slug"}})
195+
* @Route("/comment/{postSlug}/new", name="comment_new")
196+
* @ParamConverter("post", options={"mapping"={"postSlug"="slug"}})
197197
*/
198198
public function newAction(Request $request, Post $post)
199199
{

components/http_foundation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ PHP callable that is able to create an instance of your ``Request`` class::
300300
array $server = array(),
301301
$content = null
302302
) {
303-
return SpecialRequest::create(
303+
return new SpecialRequest(
304304
$query,
305305
$request,
306306
$attributes,

reference/constraints/All.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ entry in that array:
3535
/**
3636
* @Assert\All({
3737
* @Assert\NotBlank,
38-
* @Assert\Length(min = 5)
38+
* @Assert\Length(min=5)
3939
* })
4040
*/
4141
protected $favoriteColors = array();

reference/constraints/Choice.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ If your valid choice list is simple, you can pass them in directly via the
5252
protected $city;
5353
5454
/**
55-
* @Assert\Choice(choices = {"fiction", "non-fiction"}, message = "Choose a valid genre.")
55+
* @Assert\Choice(choices={"fiction", "non-fiction"}, message="Choose a valid genre.")
5656
*/
5757
protected $genre;
5858
}
@@ -159,7 +159,7 @@ constraint.
159159
class Author
160160
{
161161
/**
162-
* @Assert\Choice(callback = "getGenres")
162+
* @Assert\Choice(callback="getGenres")
163163
*/
164164
protected $genre;
165165
}
@@ -224,7 +224,7 @@ you can pass the class name and the method as an array.
224224
class Author
225225
{
226226
/**
227-
* @Assert\Choice(callback = {"Util", "getGenres"})
227+
* @Assert\Choice(callback={"Util", "getGenres"})
228228
*/
229229
protected $genre;
230230
}

reference/constraints/IsTrue.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Then you can constrain this method with ``IsTrue``.
5555
protected $token;
5656
5757
/**
58-
* @Assert\IsTrue(message = "The token is invalid")
58+
* @Assert\IsTrue(message="The token is invalid")
5959
*/
6060
public function isTokenValid()
6161
{

reference/constraints/Luhn.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ will contain a credit card number.
3434
class Transaction
3535
{
3636
/**
37-
* @Assert\Luhn(message = "Please check your credit card number.")
37+
* @Assert\Luhn(message="Please check your credit card number.")
3838
*/
3939
protected $cardNumber;
4040
}

reference/constraints/Valid.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ stores an ``Address`` instance in the ``$address`` property.
6565
6666
/**
6767
* @Assert\NotBlank
68-
* @Assert\Length(max = 5)
68+
* @Assert\Length(max=5)
6969
*/
7070
protected $zipCode;
7171
}
@@ -79,7 +79,7 @@ stores an ``Address`` instance in the ``$address`` property.
7979
{
8080
/**
8181
* @Assert\NotBlank
82-
* @Assert\Length(min = 4)
82+
* @Assert\Length(min=4)
8383
*/
8484
protected $firstName;
8585

routing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ To fix this, add a *requirement* that the ``{page}`` wildcard can *only* match n
179179
class BlogController extends Controller
180180
{
181181
/**
182-
* @Route("/blog/{page}", name="blog_list", requirements={"page": "\d+"})
182+
* @Route("/blog/{page}", name="blog_list", requirements={"page"="\d+"})
183183
*/
184184
public function listAction($page)
185185
{
@@ -277,7 +277,7 @@ So how can you make ``blog_list`` once again match when the user visits
277277
class BlogController extends Controller
278278
{
279279
/**
280-
* @Route("/blog/{page}", name="blog_list", requirements={"page": "\d+"})
280+
* @Route("/blog/{page}", name="blog_list", requirements={"page"="\d+"})
281281
*/
282282
public function listAction($page = 1)
283283
{

routing/optional_placeholders.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ This is done by including it in the ``defaults`` collection:
135135
// ...
136136
137137
/**
138-
* @Route("/blog/{page}", defaults={"page" = 1})
138+
* @Route("/blog/{page}", defaults={"page"=1})
139139
*/
140140
public function indexAction($page)
141141
{

routing/requirements.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ a routing ``{wildcard}`` to only match some regular expression:
2121
class BlogController extends Controller
2222
{
2323
/**
24-
* @Route("/blog/{page}", name="blog_list", requirements={"page": "\d+"})
24+
* @Route("/blog/{page}", name="blog_list", requirements={"page"="\d+"})
2525
*/
2626
public function listAction($page)
2727
{
@@ -97,8 +97,8 @@ URL:
9797
class MainController extends Controller
9898
{
9999
/**
100-
* @Route("/{_locale}", defaults={"_locale": "en"}, requirements={
101-
* "_locale": "en|fr"
100+
* @Route("/{_locale}", defaults={"_locale"="en"}, requirements={
101+
* "_locale"="en|fr"
102102
* })
103103
*/
104104
public function homepageAction($_locale)

templating/formats.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ be configured so that ``/about-us`` sets the request format to ``html`` while
5151
special ``_format`` placeholder in your route definition::
5252

5353
/**
54-
* @Route("/{slug}.{_format}", defaults={"_format": "html"})
54+
* @Route("/{slug}.{_format}", defaults={"_format"="html"})
5555
*/
5656
public function showAction(Request $request, $slug)
5757
{

validation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ this method must return ``true``:
642642
class Author
643643
{
644644
/**
645-
* @Assert\IsTrue(message = "The password cannot match your first name")
645+
* @Assert\IsTrue(message="The password cannot match your first name")
646646
*/
647647
public function isPasswordLegal()
648648
{

validation/severity.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ Use the ``payload`` option to configure the error level for each constraint:
3535
class User
3636
{
3737
/**
38-
* @Assert\NotBlank(payload = {"severity" = "error"})
38+
* @Assert\NotBlank(payload={"severity"="error"})
3939
*/
4040
protected $username;
4141
4242
/**
43-
* @Assert\NotBlank(payload = {"severity" = "error"})
43+
* @Assert\NotBlank(payload={"severity"="error"})
4444
*/
4545
protected $password;
4646
4747
/**
48-
* @Assert\Iban(payload = {"severity" = "warning"})
48+
* @Assert\Iban(payload={"severity"="warning"})
4949
*/
5050
protected $bankAccountNumber;
5151
}

validation/translations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ property is not empty, add the following:
3333
class Author
3434
{
3535
/**
36-
* @Assert\NotBlank(message = "author.name.not_blank")
36+
* @Assert\NotBlank(message="author.name.not_blank")
3737
*/
3838
public $name;
3939
}

0 commit comments

Comments
 (0)