Skip to content

[Messenger] doc bloc moved #11827

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _build/_themes/_exts/symfonycom/sphinx/lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class TerminalLexer(RegexLexer):
tokens = {
'root': [
('^\$', Generic.Prompt, 'bash-prompt'),
('^[^\n>]+>', Generic.Prompt, 'dos-prompt'),
('^>', Generic.Prompt, 'dos-prompt'),
('^#.+$', Comment.Single),
('^.+$', Generic.Output),
],
Expand Down
2 changes: 1 addition & 1 deletion _build/maintainer_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ interface. Then:
Merging Process
~~~~~~~~~~~~~~~

At first it's common to make mistakes and merge things badly. Don't worry. This
At first, it's common to make mistakes and merge things badly. Don't worry. This
has happened to all of us and we've always been able to recover from any mistake.

Step 1: Select the right branch to merge
Expand Down
2 changes: 2 additions & 0 deletions _build/redirection_map
Original file line number Diff line number Diff line change
Expand Up @@ -427,3 +427,5 @@
/contributing/community/other /contributing/community
/profiler/storage /profiler
/setup/composer /setup
/security/security_checker /setup
/service_container/parameters /configuration
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions _images/form/form-custom-type-postal-address.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion best_practices/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ that fit the philosophy of the framework as envisioned by its original creator

.. note::

**Best practice** is a noun that means *"a well defined procedure that is
**Best practice** is a noun that means *"a well-defined procedure that is
known to produce near-optimum results"*. And that's exactly what this
guide aims to provide. Even if you don't agree with every recommendation,
we believe these will help you build great applications with less complexity.
Expand Down
2 changes: 1 addition & 1 deletion best_practices/templates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ be used as a Twig extension.
Next: :doc:`/best_practices/forms`

.. _`Twig`: https://twig.symfony.com/
.. _`Parsedown`: http://parsedown.org/
.. _`Parsedown`: https://parsedown.org/
2 changes: 1 addition & 1 deletion bundles/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ Providing an XML Schema

XML has a very useful feature called `XML schema`_. This allows you to
describe all possible elements and attributes and their values in an XML Schema
Definition (an xsd file). This XSD file is used by IDEs for auto completion and
Definition (an XSD file). This XSD file is used by IDEs for auto completion and
it is used by the Config component to validate the elements.

In order to use the schema, the XML configuration file must provide an
Expand Down
2 changes: 1 addition & 1 deletion bundles/inheritance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
How to Use Bundle Inheritance to Override Parts of a Bundle
===========================================================

.. caution::
.. deprecated:: 3.4

Bundle inheritance was removed in Symfony 4.0, but you can
:doc:`override any part of a bundle </bundles/override>` without
Expand Down
2 changes: 1 addition & 1 deletion cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ Each custom pool becomes a service where the service id is the name of the pool
using the camel case version of its name - e.g. ``custom_thing.cache`` can be
injected automatically by naming the argument ``$customThingCache`` and type-hinting it
with either :class:`Symfony\\Contracts\\Cache\\CacheInterface` or
``Psr\\Cache\\CacheItemPoolInterface``::
``Psr\Cache\CacheItemPoolInterface``::

use Symfony\Contracts\Cache\CacheInterface;

Expand Down
4 changes: 2 additions & 2 deletions components/asset.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ simple. Hardcoding URLs can be a disadvantage because:
is essential for some applications because it allows you to control how
the assets are cached. The Asset component allows you to define different
versioning strategies for each package;
* **Moving assets location** is cumbersome and error-prone: it requires you to
* **Moving assets' location** is cumbersome and error-prone: it requires you to
carefully update the URLs of all assets included in all templates. The Asset
component allows to move assets effortlessly just by changing the base path
value associated with the package of assets;
Expand Down Expand Up @@ -302,7 +302,7 @@ constructor::
// result: http://static2.example.com/images/icon.png?v1

For each asset, one of the URLs will be randomly used. But, the selection
is deterministic, meaning that each asset will be always served by the same
is deterministic, meaning that each asset will always be served by the same
domain. This behavior simplifies the management of HTTP cache.

Request Context Aware Assets
Expand Down
2 changes: 1 addition & 1 deletion components/cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ Now you can create, retrieve, update and delete items using this cache pool::
// retrieve the cache item
$productsCount = $cache->getItem('stats.products_count');
if (!$productsCount->isHit()) {
// ... item does not exists in the cache
// ... item does not exist in the cache
}
// retrieve the value stored by the item
$total = $productsCount->get();
Expand Down
15 changes: 4 additions & 11 deletions components/cache/adapters/chain_adapter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ given adapters. This exposes a simple and efficient method for creating a layere
The ChainAdapter must be provided an array of adapters and optionally a maximum cache
lifetime as its constructor arguments::

use Symfony\Component\Cache\Adapter\ApcuAdapter;

$cache = new ChainAdapter([
use Symfony\Component\Cache\Adapter\ChainAdapter;

$cache = new ChainAdapter(
// The ordered list of adapters used to fetch cached items
array $adapters,

// The max lifetime of items propagated from lower adapters to upper ones
$maxLifetime = 0
]);
);

.. note::

Expand Down Expand Up @@ -59,11 +58,5 @@ incompatible adapters are silently ignored::
new FilesystemAdapter(), // DOES implement PruneableInterface
]);

// prune will proxy the call to FilesystemAdapter while silently skipping ApcuAdapter
// prune will proxy the call to FilesystemAdapter while silently skip ApcuAdapter
$cache->prune();

.. note::

Since Symfony 3.4, this adapter implements :class:`Symfony\\Component\\Cache\\PruneableInterface`,
allowing for manual :ref:`pruning of expired cache entries <component-cache-cache-pool-prune>` by
calling its ``prune()`` method.
2 changes: 1 addition & 1 deletion components/cache/adapters/memcached_adapter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ Available Options

``server_failure_limit`` (type: ``int``, default: ``0``)
Specifies the failure limit for server connection attempts before marking
the server as "dead". The server will remaining in the server pool unless
the server as "dead". The server will remain in the server pool unless
``auto_eject_hosts`` is enabled.

Valid option values include *any positive integer*.
Expand Down
2 changes: 1 addition & 1 deletion components/cache/cache_invalidation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ change in the state of your model. The most basic kind of invalidation is direct
items deletion. But when the state of a primary resource has spread across
several cached items, keeping them in sync can be difficult.

The Symfony Cache component provides two mechanisms to help solving this problem:
The Symfony Cache component provides two mechanisms to help solve this problem:

* :ref:`Tags-based invalidation <cache-component-tags>` for managing data dependencies;
* :ref:`Expiration based invalidation <cache-component-expiration>` for time-related dependencies.
Expand Down
2 changes: 1 addition & 1 deletion components/cache/cache_items.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ corresponding *getter* methods::
Cache Item Expiration
~~~~~~~~~~~~~~~~~~~~~

By default cache items are stored permanently. In practice, this "permanent
By default, cache items are stored permanently. In practice, this "permanent
storage" can vary greatly depending on the type of cache being used, as
explained in the :doc:`/components/cache/cache_pools` article.

Expand Down
4 changes: 2 additions & 2 deletions components/cache/cache_pools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Cache Pools and Supported Adapters

Cache Pools are the logical repositories of cache items. They perform all the
common operations on items, such as saving them or looking for them. Cache pools
are independent from the actual cache implementation. Therefore, applications
are independent of the actual cache implementation. Therefore, applications
can keep using the same cache pool even if the underlying cache mechanism
changes from a file system based cache to a Redis or database based cache.

Expand All @@ -27,7 +27,7 @@ Creating Cache Pools

Cache Pools are created through the **cache adapters**, which are classes that
implement both :class:`Symfony\\Contracts\\Cache\\CacheInterface` and
``Psr\\Cache\\CacheItemPoolInterface``. This component provides several adapters
``Psr\Cache\CacheItemPoolInterface``. This component provides several adapters
ready to use in your applications.

.. toctree::
Expand Down
2 changes: 1 addition & 1 deletion components/cache/psr6_psr16_adapters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ this use-case::
$psr6Cache = new FilesystemAdapter();

// a PSR-16 cache that uses your cache internally!
$psr16Cache = new Psr6Cache($psr6Cache);
$psr16Cache = new Psr16Cache($psr6Cache);

// now use this wherever you want
$githubApiClient = new GitHubApiClient($psr16Cache);
Expand Down
6 changes: 3 additions & 3 deletions components/config/definition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ For all nodes:
Appending Sections
------------------

If you have a complex configuration to validate then the tree can grow to
If you have a complex configuration to validate, then the tree can grow to
be large and you may want to split it up into sections. You can do this
by making a section a separate node and then appending it into the main
tree with ``append()``::
Expand Down Expand Up @@ -702,8 +702,8 @@ and sometimes only:

<connection>default</connection>

By default ``connection`` would be an array in the first case and a string
in the second making it difficult to validate. You can ensure it is always
By default, ``connection`` would be an array in the first case and a string
in the second, making it difficult to validate. You can ensure it is always
an array with ``fixXmlConfig()``.

You can further control the normalization process if you need to. For example,
Expand Down
5 changes: 3 additions & 2 deletions components/console/changing_default_command.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ name to the ``setDefaultCommand()`` method::

class HelloWorldCommand extends Command
{
protected static $defaultName = 'hello:world';

protected function configure()
{
$this->setName('hello:world')
->setDescription('Outputs \'Hello World\'');
$this->setDescription('Outputs "Hello World"');
}

protected function execute(InputInterface $input, OutputInterface $output)
Expand Down
3 changes: 2 additions & 1 deletion components/console/console_arguments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ Have a look at the following command that has three options::

class DemoArgsCommand extends Command
{
protected static $defaultName = 'demo:args';

protected function configure()
{
$this
->setName('demo:args')
->setDescription('Describe args behaviors')
->setDefinition(
new InputDefinition([
Expand Down
2 changes: 1 addition & 1 deletion components/console/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,4 @@ Listeners receive a
It is then dispatched just after the ``ConsoleEvents::ERROR`` event.
The exit code received in this case is the exception code.

.. _`reserved exit codes`: http://www.tldp.org/LDP/abs/html/exitcodes.html
.. _`reserved exit codes`: https://www.tldp.org/LDP/abs/html/exitcodes.html
2 changes: 1 addition & 1 deletion components/console/helpers/progressbar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ which starts, advances and finishes the progress bar automatically::

If ``$iterable = [1, 2]``, the previous code will output the following:

.. code-block:: terminal
.. code-block:: console

0/2 [>---------------------------] 0%
1/2 [==============>-------------] 50%
Expand Down
2 changes: 1 addition & 1 deletion components/console/helpers/table.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ You can optionally display titles at the top and the bottom of the table::
| 80-902734-1-6 | And Then There Were None | Agatha Christie |
+---------------+--------- Page 1/2 -------+------------------+

By default the width of the columns is calculated automatically based on their
By default, the width of the columns is calculated automatically based on their
contents. Use the :method:`Symfony\\Component\\Console\\Helper\\Table::setColumnWidths`
method to set the column widths explicitly::

Expand Down
3 changes: 2 additions & 1 deletion components/console/logger.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ You can rely on the logger to use this dependency inside a command::

class MyCommand extends Command
{
protected static $defaultName = 'my:command';

protected function configure()
{
$this
->setName('my:command')
->setDescription(
'Use an external dependency requiring a PSR-3 logger'
)
Expand Down
2 changes: 1 addition & 1 deletion components/dependency_injection/compilation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ serves at dumping the compiled container::
}

``ProjectServiceContainer`` is the default name given to the dumped container
class. However you can change this with the ``class`` option when you
class. However, you can change this with the ``class`` option when you
dump it::

// ...
Expand Down
8 changes: 8 additions & 0 deletions components/dotenv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ Use environment variables in values by prefixing variables with ``$``:
DB_USER=root
DB_PASS=${DB_USER}pass # Include the user as a password prefix

.. note::

The order is important when some env var depends on the value of other env
vars. In the above example, ``DB_PASS`` must be defined after ``DB_USER``.
Moreover, if you define multiple ``.env`` files and put ``DB_PASS`` first,
its value will depend on the ``DB_USER`` value defined in other files
instead of the value defined in this file.

Embed commands via ``$()`` (not supported on Windows):

.. code-block:: terminal
Expand Down
48 changes: 9 additions & 39 deletions components/event_dispatcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Introduction
------------

Object-oriented code has gone a long way to ensuring code extensibility.
By creating classes that have well defined responsibilities, your code becomes
By creating classes that have well-defined responsibilities, your code becomes
more flexible and a developer can extend them with subclasses to modify
their behaviors. But if they want to share the changes with other developers
who have also made their own subclasses, code inheritance is no longer the
Expand Down Expand Up @@ -111,7 +111,7 @@ Often times, data about a specific event needs to be passed along with the
case, a special subclass that has additional methods for retrieving and
overriding information can be passed when dispatching an event. For example,
the ``kernel.response`` event uses a
:class:`Symfony\\Component\\HttpKernel\\Event\\FilterResponseEvent`, which
:class:`Symfony\\Component\\HttpKernel\\Event\\ResponseEvent`, which
contains methods to get and even replace the ``Response`` object.

The Dispatcher
Expand Down Expand Up @@ -291,8 +291,8 @@ Dispatch the Event

The :method:`Symfony\\Component\\EventDispatcher\\EventDispatcher::dispatch`
method notifies all listeners of the given event. It takes two arguments:
the name of the event to dispatch and the ``Event`` instance to pass to
each listener of that event::
the ``Event`` instance to pass to each listener of that event and the name
of the event to dispatch and ::

use Acme\Store\Event\OrderPlacedEvent;
use Acme\Store\Order;
Expand All @@ -303,7 +303,7 @@ each listener of that event::

// creates the OrderPlacedEvent and dispatches it
$event = new OrderPlacedEvent($order);
$dispatcher->dispatch(OrderPlacedEvent::NAME, $event);
$dispatcher->dispatch($event, OrderPlacedEvent::NAME);

Notice that the special ``OrderPlacedEvent`` object is created and passed to
the ``dispatch()`` method. Now, any listener to the ``order.placed``
Expand Down Expand Up @@ -334,7 +334,7 @@ Take the following example of a subscriber that subscribes to the

use Acme\Store\Event\OrderPlacedEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;

class StoreSubscriber implements EventSubscriberInterface
Expand All @@ -350,12 +350,12 @@ Take the following example of a subscriber that subscribes to the
];
}

public function onKernelResponsePre(FilterResponseEvent $event)
public function onKernelResponsePre(ResponseEvent $event)
{
// ...
}

public function onKernelResponsePost(FilterResponseEvent $event)
public function onKernelResponsePost(ResponseEvent $event)
{
// ...
}
Expand Down Expand Up @@ -423,7 +423,7 @@ It is possible to detect if an event was stopped by using the
method which returns a boolean value::

// ...
$dispatcher->dispatch('foo.event', $event);
$dispatcher->dispatch($event, 'foo.event');
if ($event->isPropagationStopped()) {
// ...
}
Expand All @@ -441,36 +441,6 @@ name and a reference to itself to the listeners. This can lead to some advanced
applications of the ``EventDispatcher`` including dispatching other events inside
listeners, chaining events or even lazy loading listeners into the dispatcher object.

.. index::
single: EventDispatcher; Dispatcher shortcuts

.. _event_dispatcher-shortcuts:

Dispatcher Shortcuts
~~~~~~~~~~~~~~~~~~~~

If you do not need a custom event object, you can rely on a plain
:class:`Symfony\\Contracts\\EventDispatcher\\Event` object. You do not even
need to pass this to the dispatcher as it will create one by default unless you
specifically pass one::

$dispatcher->dispatch('order.placed');

Moreover, the event dispatcher always returns whichever event object that
was dispatched, i.e. either the event that was passed or the event that
was created internally by the dispatcher. This allows for nice shortcuts::

if (!$dispatcher->dispatch('foo.event')->isPropagationStopped()) {
// ...
}

Or::

$event = new OrderPlacedEvent($order);
$order = $dispatcher->dispatch('bar.event', $event)->getOrder();

and so on.

.. index::
single: EventDispatcher; Event name introspection

Expand Down
Loading