Skip to content

Use valid number of backslashes, depending on 1 or 2 ticks #11771

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

Merged
merged 1 commit into from
Jun 18, 2019
Merged
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
14 changes: 7 additions & 7 deletions components/cache/cache_pools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Saving Cache Items
------------------

The most common method to save cache items is
``Psr\\Cache\\CacheItemPoolInterface::save``, which stores the
``Psr\Cache\CacheItemPoolInterface::save``, which stores the
item in the cache immediately (it returns ``true`` if the item was saved or
``false`` if some error occurred)::

Expand All @@ -80,9 +80,9 @@ item in the cache immediately (it returns ``true`` if the item was saved or

Sometimes you may prefer to not save the objects immediately in order to
increase the application performance. In those cases, use the
``Psr\\Cache\\CacheItemPoolInterface::saveDeferred`` method to mark cache
``Psr\Cache\CacheItemPoolInterface::saveDeferred`` method to mark cache
items as "ready to be persisted" and then call to
``Psr\\Cache\\CacheItemPoolInterface::commit`` method when you are ready
``Psr\Cache\CacheItemPoolInterface::commit`` method when you are ready
to persist them all::

// ...
Expand All @@ -103,22 +103,22 @@ Removing Cache Items
--------------------

Cache Pools include methods to delete a cache item, some of them or all of them.
The most common is ``Psr\\Cache\\CacheItemPoolInterface::deleteItem``,
The most common is ``Psr\Cache\CacheItemPoolInterface::deleteItem``,
which deletes the cache item identified by the given key (it returns ``true``
when the item is successfully deleted or doesn't exist and ``false`` otherwise)::

// ...
$isDeleted = $cache->deleteItem('user_'.$userId);

Use the ``Psr\\Cache\\CacheItemPoolInterface::deleteItems`` method to
Use the ``Psr\Cache\CacheItemPoolInterface::deleteItems`` method to
delete several cache items simultaneously (it returns ``true`` only if all the
items have been deleted, even when any or some of them don't exist)::

// ...
$areDeleted = $cache->deleteItems(['category1', 'category2']);

Finally, to remove all the cache items stored in the pool, use the
``Psr\\Cache\\CacheItemPoolInterface::clear`` method (which returns ``true``
``Psr\Cache\CacheItemPoolInterface::clear`` method (which returns ``true``
when all items are successfully deleted)::

// ...
Expand Down Expand Up @@ -158,7 +158,7 @@ Pruning Cache Items
Some cache pools do not include an automated mechanism for pruning expired cache items.
For example, the :ref:`FilesystemAdapter <component-cache-filesystem-adapter>` cache
does not remove expired cache items *until an item is explicitly requested and determined to
be expired*, for example, via a call to ``Psr\\Cache\\CacheItemPoolInterface::getItem``.
be expired*, for example, via a call to ``Psr\Cache\CacheItemPoolInterface::getItem``.
Under certain workloads, this can cause stale cache entries to persist well past their
expiration, resulting in a sizable consumption of wasted disk or memory space from excess,
expired cache items.
Expand Down
4 changes: 2 additions & 2 deletions components/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ to bootstrap or access Twig and add the :class:`Symfony\\Bridge\\Twig\\Extension

.. versionadded:: 1.30

The ``Twig\\RuntimeLoader\\FactoryRuntimeLoader`` was introduced in Twig 1.30.
The ``Twig\RuntimeLoader\FactoryRuntimeLoader`` was introduced in Twig 1.30.

The exact details of your `Twig Configuration`_ will vary, but the goal is
always to add the :class:`Symfony\\Bridge\\Twig\\Extension\\FormExtension`
Expand Down Expand Up @@ -263,7 +263,7 @@ installed:
$ composer require symfony/translation symfony/config

Next, add the :class:`Symfony\\Bridge\\Twig\\Extension\\TranslationExtension`
to your ``Twig\\Environment`` instance::
to your ``Twig\Environment`` instance::

use Symfony\Bridge\Twig\Extension\TranslationExtension;
use Symfony\Component\Form\Forms;
Expand Down
2 changes: 1 addition & 1 deletion contributing/code/bc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public methods and properties.
.. caution::

Classes, properties and methods that bear the tag ``@internal`` as well as
the classes located in the various ``*\\Tests\\`` namespaces are an
the classes located in the various ``*\Tests\`` namespaces are an
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before:
Screenshot 2019-06-18 10 08 19

exception to this rule. They are meant for internal use only and should
not be accessed by your own code.

Expand Down
2 changes: 1 addition & 1 deletion create_framework/separation_of_concerns.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ simple principle: the logic is about creating the Response associated with a
Request.

Let's create our very own namespace for our framework: ``Simplex``. Move the
request handling logic into its own ``Simplex\\Framework`` class::
request handling logic into its own ``Simplex\Framework`` class::
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using 2 backticks, 1 backslash is enough, otherwise it looks like this:
Screenshot 2019-06-18 10 08 44

Which isn't a valid namespace.


// example.com/src/Simplex/Framework.php
namespace Simplex;
Expand Down
2 changes: 1 addition & 1 deletion reference/dic_tags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ assetic.formula_loader
**Purpose**: Add a formula loader to the current asset manager

A Formula loader is a class implementing
``Assetic\\Factory\Loader\\FormulaLoaderInterface`` interface. This class
``Assetic\Factory\Loader\FormulaLoaderInterface`` interface. This class
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was definitely wrong before 😄 and now spotted by the doctor 💃

is responsible for loading assets from a particular kind of resources (for
instance, twig template). Assetic ships loaders for PHP and Twig templates.

Expand Down