From abe4c85a409f9cf5e536e729341b0467022b5d46 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Tue, 18 Jun 2019 10:06:28 +0200 Subject: [PATCH] Use valid number of backslashes, depending on 1 or 2 ticks @javiereguiluz I created a rule for the doctor :+1: --- components/cache/cache_pools.rst | 14 +++++++------- components/form.rst | 4 ++-- contributing/code/bc.rst | 2 +- create_framework/separation_of_concerns.rst | 2 +- reference/dic_tags.rst | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/components/cache/cache_pools.rst b/components/cache/cache_pools.rst index 45bc9e38f53..57a4fe33337 100644 --- a/components/cache/cache_pools.rst +++ b/components/cache/cache_pools.rst @@ -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):: @@ -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:: // ... @@ -103,14 +103,14 @@ 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):: @@ -118,7 +118,7 @@ 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):: // ... @@ -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 ` 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. diff --git a/components/form.rst b/components/form.rst index 9a7ba0433b4..6b74f8407c1 100644 --- a/components/form.rst +++ b/components/form.rst @@ -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` @@ -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; diff --git a/contributing/code/bc.rst b/contributing/code/bc.rst index b9654f53002..fbecf1ab880 100644 --- a/contributing/code/bc.rst +++ b/contributing/code/bc.rst @@ -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 exception to this rule. They are meant for internal use only and should not be accessed by your own code. diff --git a/create_framework/separation_of_concerns.rst b/create_framework/separation_of_concerns.rst index c318d2da459..7444137ed71 100644 --- a/create_framework/separation_of_concerns.rst +++ b/create_framework/separation_of_concerns.rst @@ -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:: // example.com/src/Simplex/Framework.php namespace Simplex; diff --git a/reference/dic_tags.rst b/reference/dic_tags.rst index 2494272e8fb..deafbbef14f 100644 --- a/reference/dic_tags.rst +++ b/reference/dic_tags.rst @@ -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 is responsible for loading assets from a particular kind of resources (for instance, twig template). Assetic ships loaders for PHP and Twig templates.