Skip to content

Commit 7054cf4

Browse files
committed
Ref symfony#3903 - Normalize methods listings
1 parent 92a186d commit 7054cf4

File tree

4 files changed

+100
-92
lines changed

4 files changed

+100
-92
lines changed

components/http_foundation/sessions.rst

+61-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`.
@@ -132,6 +132,7 @@ an array. A few methods exist for "Bag" management:
132132
Session Metadata
133133
................
134134

135+
135136
:method:`Symfony\\Component\\HttpFoundation\\Session\\Session::getMetadataBag`
136137
Gets the :class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\MetadataBag`
137138
which contains information about the session.
@@ -157,16 +158,16 @@ bag types if necessary.
157158
:class:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface` has
158159
the following API which is intended mainly for internal purposes:
159160

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.
161+
:method:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface::getStorageKey`
162+
Returns the key which the bag will ultimately store its array under in ``$_SESSION``.
163+
Generally this value can be left at its default and is for internal use.
163164

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.
165+
:method:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface::initialize`
166+
This is called internally by Symfony session storage classes to link bag data
167+
to the session.
167168

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

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

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

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

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

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

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

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

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

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

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.
229+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::replace`
230+
Sets multiple attributes at once: takes a keyed array and sets each key => value pair.
230231

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

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

237238
Flash Messages
238239
~~~~~~~~~~~~~~
@@ -246,49 +247,49 @@ updated page or an error page. Flash messages set in the previous page request
246247
would be displayed immediately on the subsequent page load for that session.
247248
This is however just one application for flash messages.
248249

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.
250+
:class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\AutoExpireFlashBag`
251+
In this implementation, messages set in one page-load will
252+
be available for display only on the next page load. These messages will auto
253+
expire regardless of if they are retrieved or not.
253254

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.
255+
:class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBag`
256+
In this implementation, messages will remain in the session until
257+
they are explicitly retrieved or cleared. This makes it possible to use ESI
258+
caching.
258259

259260
:class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface`
260261
has a simple API
261262

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

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``.
266+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::set`
267+
Sets flashes by type; This method conveniently takes both single messages as
268+
a ``string`` or multiple messages in an ``array``.
268269

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

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

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;
276+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::all`
277+
Gets all flashes (as a keyed array of arrays) and clears the flashes from the bag.
277278

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

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

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

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

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

293294
For simple applications it is usually sufficient to have one flash message per
294295
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)