Skip to content

Commit 8f8ddff

Browse files
committed
Merge branch '4.0'
* 4.0: (33 commits) Fix YAML identation Update rendering.rst Update formatter.rst remove part about adding extension Add "allowed_classes" argument for unserialize() Removed another unneeded closing block name Fix little typo fix indentation fix versionadded directive Fix a method reference value Fix "class_exists" PHP function URL Removed another unneeded closing block name add missing ";" Fix little typo Remove faulty PHP code blocks Fix typo in method setETag. Correct method name is setEtag Add kernel to list of excluded registered services Changes after code review Changes after code review Changes after code review ...
2 parents e192330 + 81645f9 commit 8f8ddff

22 files changed

+148
-151
lines changed

components/cache/psr6_psr16_adapters.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ instead. No problem! The Cache component provides the
3737
this use-case::
3838

3939
use Symfony\Component\Cache\Simple\FilesystemCache;
40-
use Symfony\Component\Cache\Adapter\SimpleCacheAdapter
40+
use Symfony\Component\Cache\Adapter\SimpleCacheAdapter;
4141

4242
// the PSR-16 cache object that you want to use
4343
$psr16Cache = new FilesystemCache();

components/intl.rst

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,6 @@ replace the intl classes:
4848

4949
Composer automatically exposes these classes in the global namespace.
5050

51-
If you don't use Composer but the
52-
:doc:`Symfony ClassLoader component </components/class_loader>`,
53-
you need to expose them manually by adding the following lines to your autoload
54-
code::
55-
56-
if (!function_exists('intl_is_failure')) {
57-
require '/path/to/Icu/Resources/stubs/functions.php';
58-
59-
$loader->registerPrefixFallback('/path/to/Icu/Resources/stubs');
60-
}
61-
6251
Writing and Reading Resource Bundles
6352
------------------------------------
6453

configuration/front_controllers_and_kernel.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ you must implement them all:
8383
:method:`Symfony\\Component\\HttpKernel\\KernelInterface::registerBundles`
8484
It must return an array of all bundles needed to run the application.
8585

86-
:method:`Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait:configureRoutes`
86+
:method:`Symfony\\Bundle\\FrameworkBundle\\Kernel\\MicroKernelTrait::configureRoutes`
8787
It adds individual routes or collections of routes to the application (for
8888
example loading the routes defined in some config file).
8989

contributing/community/review-comments.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,18 @@ that, but swearing/cursing and name calling doesn't really encourage anyone to
4343
help you. Take a deep breath, count to 10 and try to *clearly* explain what problems
4444
you encounter.
4545

46-
Gender-neutral Pronouns
47-
-----------------------
46+
Inclusive Language
47+
------------------
4848

49-
While not "formally" required, it's better to use gender-neutral pronouns.
50-
Unless someone "indicated" their pronouns, use "they", "them" instead of
51-
"he", "she", "his", "hers", "his/hers", "he/she", etc.
49+
In an effort to be inclusive to a wide group of people, it's recommended to
50+
use personal pronouns that don't suggest a particular gender. Unless someone
51+
has stated their pronouns, use "they", "them" instead of "he", "she", "his",
52+
"hers", "his/hers", "he/she", etc.
5253

53-
Try to avoid using wording that may be considered excluding and needlessly gendered,
54-
like for example words that have a male base. For example we recommend to use other
55-
words like "folks", "team", "everyone" in place of "guys".
54+
Try to avoid using wording that may be considered excluding, needlessly gendered
55+
(e.g. words that have a male or female base), racially motivated or singles out
56+
a particular group in society. For example, it's recommended to use words like
57+
"folks", "team", "everyone" instead of "guys", "ladies", "yanks", etc.
5658

5759
Giving Positive Feedback
5860
------------------------

controller.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ method renders a template **and** puts that content into a ``Response``
182182
object for you::
183183

184184
// renders templates/lucky/number.html.twig
185-
return $this->render('lucky/number.html.twig', array('name' => $name));
185+
return $this->render('lucky/number.html.twig', array('number' => $number));
186186

187187
Templating and Twig are explained more in the
188188
:doc:`Creating and Using Templates article </templating>`.
@@ -308,7 +308,7 @@ use:
308308
309309
$ php bin/console make:crud Product
310310
311-
.. versionadded::
311+
.. versionadded:: 1.2
312312
The ``make:crud`` command was introduced in MakerBundle 1.2.
313313

314314
.. index::

doctrine.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ knows that the first migration was already executed earlier. Behind the scenes,
272272
automatically manages a ``migration_versions`` table to track this.
273273

274274
Each time you make a change to your schema, run these two commands to generate the
275-
migration and then execute it. Be sure to commit the migration files and run execute
275+
migration and then execute it. Be sure to commit the migration files and execute
276276
them when you deploy.
277277

278278
.. _doctrine-generating-getters-and-setters:
@@ -316,7 +316,7 @@ then go to the Code -> Generate menu and select "Getters and Setters"::
316316

317317
.. tip::
318318

319-
Typically you won't need a ``setId()`` method: Doctrine will set this for you
319+
Typically you won't need a ``setId()`` method: Doctrine will set the ID
320320
automatically.
321321

322322
Persisting Objects to the Database

form/bootstrap4.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ template which other templates extend from):
1616
{% endblock %}
1717
{% block head_js %}
1818
<!-- Copy JavaScript from https://getbootstrap.com/docs/4.0/getting-started/introduction/#js -->
19-
{% endblock head %}
19+
{% endblock %}
2020

2121
If your application uses modern front-end practices, it's better to use
2222
:doc:`Webpack Encore </frontend>` and follow :doc:`this tutorial </frontend/encore/bootstrap>`
@@ -75,7 +75,7 @@ If you prefer to apply the Bootstrap styles on a form to form basis, include the
7575
{% block body %}
7676
<h1>User Sign Up:</h1>
7777
{{ form(form) }}
78-
{% endblock body %}
78+
{% endblock %}
7979
8080
Accessibility
8181
-------------

form/rendering.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ of code. Of course, you'll usually need much more flexibility when rendering:
2121

2222
.. code-block:: html+php
2323

24-
<!-- templates/default/newAction.html.php -->
24+
<!-- templates/default/new.html.php -->
2525
<?php echo $view['form']->start($form) ?>
2626
<?php echo $view['form']->errors($form) ?>
2727

frontend/encore/server-data.rst

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,18 @@ Fetch this in JavaScript:
1616

1717
.. code-block:: javascript
1818
19-
// jquery isn't required, but makes things simple
20-
var $ = require('jquery');
21-
22-
$(document).ready(function() {
23-
var isAuthenticated = $('.js-user-rating').data('is-authenticated');
19+
document.addEventListener('DOMContentLoaded', function() {
20+
var userRating = document.querySelector('.js-user-rating');
21+
var isAuthenticated = userRating.dataset.isAuthenticated;
2422
});
2523
24+
.. note::
25+
26+
When `accessing data attributes from JavaScript`_, the attribute names are
27+
converted from dash-style to camelCase. For example, ``data-is-authenticated``
28+
becomes ``isAuthenticated`` and ``data-number-of-reviews`` becomes
29+
``numberOfReviews``.
30+
2631
There is no size limit for the value of the ``data-`` attributes, so you can
2732
store any content. In Twig, use the ``html_attr`` escaping strategy to avoid messing
2833
with HTML attributes. For example, if your ``User`` object has some ``getProfileData()``
@@ -33,3 +38,5 @@ method that returns an array, you could do the following:
3338
<div data-user-profile="{{ app.user ? app.user.profileData|json_encode|e('html_attr') : '' }}">
3439
<!-- ... -->
3540
</div>
41+
42+
.. _`accessing data attributes from JavaScript`: https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes

http_cache/validation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ exposing a simple and efficient pattern::
200200

201201
// create a Response with an ETag and/or a Last-Modified header
202202
$response = new Response();
203-
$response->setETag($article->computeETag());
203+
$response->setEtag($article->computeETag());
204204
$response->setLastModified($article->getPublishedAt());
205205

206206
// Set response as public. Otherwise it will be private by default.

0 commit comments

Comments
 (0)