Skip to content

Commit 9039e5b

Browse files
ternelwouterj
authored andcommitted
Ref #3903 - Normalize methods listings
1 parent 92a186d commit 9039e5b

File tree

5 files changed

+112
-102
lines changed

5 files changed

+112
-102
lines changed

book/forms.rst

+13-10
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,19 @@ helper functions:
167167

168168
That's it! Just three lines are needed to render the complete form:
169169

170-
* ``form_start(form)`` - Renders the start tag of the form, including the
171-
correct enctype attribute when using file uploads;
172-
173-
* ``form_widget(form)`` - Renders all of the fields, which includes the field
174-
element itself, a label and any validation error messages for the field;
175-
176-
* ``form_end()`` - Renders the end tag of the form and any fields that have not
177-
yet been rendered, in case you rendered each field yourself. This is useful
178-
for rendering hidden fields and taking advantage of the automatic
179-
:ref:`CSRF Protection <forms-csrf>`.
170+
``form_start(form)``
171+
Renders the start tag of the form, including the correct enctype attribute
172+
when using file uploads.
173+
174+
``form_widget(form)``
175+
Renders all of the fields, which includes the field element itself, a label
176+
and any validation error messages for the field.
177+
178+
``form_end()``
179+
Renders the end tag of the form and any fields that have not
180+
yet been rendered, in case you rendered each field yourself. This is useful
181+
for rendering hidden fields and taking advantage of the automatic
182+
:ref:`CSRF Protection <forms-csrf>`.
180183

181184
.. seealso::
182185

components/http_foundation/sessions.rst

+60-60
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ Session Attributes
107107
Returns true if the attribute exists.
108108

109109
:method:`Symfony\\Component\\HttpFoundation\\Session\\Session::replace`
110-
Sets multiple attributes at once: takes a keyed array and sets each key => value pair;
110+
Sets multiple attributes at once: takes a keyed array and sets each key => value pair.
111111

112112
:method:`Symfony\\Component\\HttpFoundation\\Session\\Session::remove`
113-
Deletes an attribute by key;
113+
Deletes an attribute by key.
114114

115115
:method:`Symfony\\Component\\HttpFoundation\\Session\\Session::clear`
116116
Clear all attributes.
@@ -123,7 +123,7 @@ an array. A few methods exist for "Bag" management:
123123

124124
:method:`Symfony\\Component\\HttpFoundation\\Session\\Session::getBag`
125125
Gets a :class:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface` by
126-
bag name;
126+
bag name.
127127

128128
:method:`Symfony\\Component\\HttpFoundation\\Session\\Session::getFlashBag`
129129
Gets the :class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface`.
@@ -157,16 +157,16 @@ bag types if necessary.
157157
:class:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface` has
158158
the following API which is intended mainly for internal purposes:
159159

160-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface::getStorageKey`:
161-
Returns the key which the bag will ultimately store its array under in ``$_SESSION``.
162-
Generally this value can be left at its default and is for internal use.
160+
:method:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface::getStorageKey`
161+
Returns the key which the bag will ultimately store its array under in ``$_SESSION``.
162+
Generally this value can be left at its default and is for internal use.
163163

164-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface::initialize`:
165-
This is called internally by Symfony session storage classes to link bag data
166-
to the session.
164+
:method:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface::initialize`
165+
This is called internally by Symfony session storage classes to link bag data
166+
to the session.
167167

168-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface::getName`:
169-
Returns the name of the session bag.
168+
:method:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface::getName`
169+
Returns the name of the session bag.
170170

171171
Attributes
172172
~~~~~~~~~~
@@ -175,11 +175,11 @@ The purpose of the bags implementing the :class:`Symfony\\Component\\HttpFoundat
175175
is to handle session attribute storage. This might include things like user ID,
176176
and remember me login settings or other user based state information.
177177

178-
* :class:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBag`
179-
This is the standard default implementation.
178+
:class:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBag`
179+
This is the standard default implementation.
180180

181-
* :class:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\NamespacedAttributeBag`
182-
This implementation allows for attributes to be stored in a structured namespace.
181+
:class:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\NamespacedAttributeBag`
182+
This implementation allows for attributes to be stored in a structured namespace.
183183

184184
Any plain key-value storage system is limited in the extent to which
185185
complex data can be stored since each key must be unique. You can achieve
@@ -210,29 +210,29 @@ This way you can easily access a key within the stored array directly and easily
210210
:class:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface`
211211
has a simple API
212212

213-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::set`:
214-
Sets an attribute by key;
213+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::set`
214+
Sets an attribute by key.
215215

216-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::get`:
217-
Gets an attribute by key;
216+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::get`
217+
Gets an attribute by key.
218218

219-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::all`:
220-
Gets all attributes as an array of key => value;
219+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::all`
220+
Gets all attributes as an array of key => value.
221221

222-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::has`:
223-
Returns true if the attribute exists;
222+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::has`
223+
Returns true if the attribute exists.
224224

225-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::keys`:
226-
Returns an array of stored attribute keys;
225+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::keys`
226+
Returns an array of stored attribute keys.
227227

228-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::replace`:
229-
Sets multiple attributes at once: takes a keyed array and sets each key => value pair.
228+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::replace`
229+
Sets multiple attributes at once: takes a keyed array and sets each key => value pair.
230230

231-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::remove`:
232-
Deletes an attribute by key;
231+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::remove`
232+
Deletes an attribute by key.
233233

234-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::clear`:
235-
Clear the bag;
234+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::clear`
235+
Clear the bag.
236236

237237
Flash Messages
238238
~~~~~~~~~~~~~~
@@ -246,49 +246,49 @@ updated page or an error page. Flash messages set in the previous page request
246246
would be displayed immediately on the subsequent page load for that session.
247247
This is however just one application for flash messages.
248248

249-
* :class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\AutoExpireFlashBag`
250-
In this implementation, messages set in one page-load will
251-
be available for display only on the next page load. These messages will auto
252-
expire regardless of if they are retrieved or not.
249+
:class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\AutoExpireFlashBag`
250+
In this implementation, messages set in one page-load will
251+
be available for display only on the next page load. These messages will auto
252+
expire regardless of if they are retrieved or not.
253253

254-
* :class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBag`
255-
In this implementation, messages will remain in the session until
256-
they are explicitly retrieved or cleared. This makes it possible to use ESI
257-
caching.
254+
:class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBag`
255+
In this implementation, messages will remain in the session until
256+
they are explicitly retrieved or cleared. This makes it possible to use ESI
257+
caching.
258258

259259
:class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface`
260260
has a simple API
261261

262-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::add`:
263-
Adds a flash message to the stack of specified type;
262+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::add`
263+
Adds a flash message to the stack of specified type.
264264

265-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::set`:
266-
Sets flashes by type; This method conveniently takes both single messages as
267-
a ``string`` or multiple messages in an ``array``.
265+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::set`
266+
Sets flashes by type; This method conveniently takes both single messages as
267+
a ``string`` or multiple messages in an ``array``.
268268

269-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::get`:
270-
Gets flashes by type and clears those flashes from the bag;
269+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::get`
270+
Gets flashes by type and clears those flashes from the bag.
271271

272-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::setAll`:
273-
Sets all flashes, accepts a keyed array of arrays ``type => array(messages)``;
272+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::setAll`
273+
Sets all flashes, accepts a keyed array of arrays ``type => array(messages)``.
274274

275-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::all`:
276-
Gets all flashes (as a keyed array of arrays) and clears the flashes from the bag;
275+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::all`
276+
Gets all flashes (as a keyed array of arrays) and clears the flashes from the bag.
277277

278-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::peek`:
279-
Gets flashes by type (read only);
278+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::peek`
279+
Gets flashes by type (read only).
280280

281-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::peekAll`:
282-
Gets all flashes (read only) as keyed array of arrays;
281+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::peekAll`
282+
Gets all flashes (read only) as keyed array of arrays.
283283

284-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::has`:
285-
Returns true if the type exists, false if not;
284+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::has`
285+
Returns true if the type exists, false if not.
286286

287-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::keys`:
288-
Returns an array of the stored flash types;
287+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::keys`
288+
Returns an array of the stored flash types.
289289

290-
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::clear`:
291-
Clears the bag;
290+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::clear`
291+
Clears the bag.
292292

293293
For simple applications it is usually sufficient to have one flash message per
294294
type, for example a confirmation notice after a form is submitted. However,

components/security/authorization.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ itself depends on multiple voters, and makes a final verdict based on all
4040
the votes (either positive, negative or neutral) it has received. It
4141
recognizes several strategies:
4242

43-
* ``affirmative`` (default)
43+
``affirmative`` (default)
4444
grant access as soon as any voter returns an affirmative response;
4545

46-
* ``consensus``
46+
``consensus``
4747
grant access if there are more voters granting access than there are denying;
4848

49-
* ``unanimous``
49+
``unanimous``
5050
only grant access if none of the voters has denied access;
5151

5252
.. code-block:: php
@@ -85,14 +85,14 @@ of :class:`Symfony\\Component\\Security\\Core\\Authorization\\Voter\\VoterInterf
8585
which means they have to implement a few methods which allows the decision
8686
manager to use them:
8787

88-
* ``supportsAttribute($attribute)``
88+
``supportsAttribute($attribute)``
8989
will be used to check if the voter knows how to handle the given attribute;
9090

91-
* ``supportsClass($class)``
91+
``supportsClass($class)``
9292
will be used to check if the voter is able to grant or deny access for
9393
an object of the given class;
9494

95-
* ``vote(TokenInterface $token, $object, array $attributes)``
95+
``vote(TokenInterface $token, $object, array $attributes)``
9696
this method will do the actual voting and return a value equal to one
9797
of the class constants of :class:`Symfony\\Component\\Security\\Core\\Authorization\\Voter\\VoterInterface`,
9898
i.e. ``VoterInterface::ACCESS_GRANTED``, ``VoterInterface::ACCESS_DENIED``

cookbook/form/create_custom_field_type.rst

+17-14
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,23 @@ all of the logic and rendering of that field type. To see some of the logic,
6060
check out the `ChoiceType`_ class. There are three methods that are particularly
6161
important:
6262

63-
* ``buildForm()`` - Each field type has a ``buildForm`` method, which is where
64-
you configure and build any field(s). Notice that this is the same method
65-
you use to setup *your* forms, and it works the same here.
66-
67-
* ``buildView()`` - This method is used to set any extra variables you'll
68-
need when rendering your field in a template. For example, in `ChoiceType`_,
69-
a ``multiple`` variable is set and used in the template to set (or not
70-
set) the ``multiple`` attribute on the ``select`` field. See `Creating a Template for the Field`_
71-
for more details.
72-
73-
* ``setDefaultOptions()`` - This defines options for your form type that
74-
can be used in ``buildForm()`` and ``buildView()``. There are a lot of
75-
options common to all fields (see :doc:`/reference/forms/types/form`),
76-
but you can create any others that you need here.
63+
``buildForm()``
64+
Each field type has a ``buildForm`` method, which is where
65+
you configure and build any field(s). Notice that this is the same method
66+
you use to setup *your* forms, and it works the same here.
67+
68+
``buildView()``
69+
This method is used to set any extra variables you'll
70+
need when rendering your field in a template. For example, in `ChoiceType`_,
71+
a ``multiple`` variable is set and used in the template to set (or not
72+
set) the ``multiple`` attribute on the ``select`` field. See `Creating a Template for the Field`_
73+
for more details.
74+
75+
``setDefaultOptions()``
76+
This defines options for your form type that
77+
can be used in ``buildForm()`` and ``buildView()``. There are a lot of
78+
options common to all fields (see :doc:`/reference/forms/types/form`),
79+
but you can create any others that you need here.
7780

7881
.. tip::
7982

cookbook/security/custom_authentication_provider.rst

+16-12
Original file line numberDiff line numberDiff line change
@@ -333,18 +333,22 @@ create a class which implements
333333
The :class:`Symfony\\Bundle\\SecurityBundle\\DependencyInjection\\Security\\Factory\\SecurityFactoryInterface`
334334
requires the following methods:
335335

336-
* ``create`` method, which adds the listener and authentication provider
337-
to the DI container for the appropriate security context;
338-
339-
* ``getPosition`` method, which must be of type ``pre_auth``, ``form``, ``http``,
340-
and ``remember_me`` and defines the position at which the provider is called;
341-
342-
* ``getKey`` method which defines the configuration key used to reference
343-
the provider in the firewall configuration;
344-
345-
* ``addConfiguration`` method, which is used to define the configuration
346-
options underneath the configuration key in your security configuration.
347-
Setting configuration options are explained later in this chapter.
336+
``create``
337+
Method which adds the listener and authentication provider
338+
to the DI container for the appropriate security context.
339+
340+
``getPosition``
341+
Method which must be of type ``pre_auth``, ``form``, ``http``,
342+
and ``remember_me`` and defines the position at which the provider is called.
343+
344+
``getKey``
345+
Method which defines the configuration key used to reference
346+
the provider in the firewall configuration.
347+
348+
``addConfiguration``
349+
Method which is used to define the configuration
350+
options underneath the configuration key in your security configuration.
351+
Setting configuration options are explained later in this chapter.
348352

349353
.. note::
350354

0 commit comments

Comments
 (0)