Skip to content

Commit 8cd3a84

Browse files
committed
Merge branch '3.4' into 4.0
* 3.4: Adding a documentation page about Bootstrap 4 form theme [#9413] some minor tweaks Ask users to create two commits for reproducers Improved variable naming
2 parents d18e995 + abc6007 commit 8cd3a84

18 files changed

+200
-68
lines changed

components/cache.rst

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -60,43 +60,43 @@ instantiate :class:`Symfony\\Component\\Cache\\Simple\\FilesystemCache`::
6060
Now you can create, retrieve, update and delete items using this object::
6161

6262
// save a new item in the cache
63-
$cache->set('stats.num_products', 4711);
63+
$cache->set('stats.products_count', 4711);
6464

6565
// or set it with a custom ttl
66-
// $cache->set('stats.num_products', 4711, 3600);
66+
// $cache->set('stats.products_count', 4711, 3600);
6767

6868
// retrieve the cache item
69-
if (!$cache->has('stats.num_products')) {
69+
if (!$cache->has('stats.products_count')) {
7070
// ... item does not exists in the cache
7171
}
7272

7373
// retrieve the value stored by the item
74-
$numProducts = $cache->get('stats.num_products');
74+
$productsCount = $cache->get('stats.products_count');
7575

7676
// or specify a default value, if the key doesn't exist
77-
// $numProducts = $cache->get('stats.num_products', 100);
77+
// $productsCount = $cache->get('stats.products_count', 100);
7878

7979
// remove the cache key
80-
$cache->delete('stats.num_products');
80+
$cache->delete('stats.products_count');
8181

8282
// clear *all* cache keys
8383
$cache->clear();
8484

8585
You can also work with multiple items at once::
8686

8787
$cache->setMultiple(array(
88-
'stats.num_products' => 4711,
89-
'stats.num_users' => 1356,
88+
'stats.products_count' => 4711,
89+
'stats.users_count' => 1356,
9090
));
9191

9292
$stats = $cache->getMultiple(array(
93-
'stats.num_products',
94-
'stats.num_users',
93+
'stats.products_count',
94+
'stats.users_count',
9595
));
9696

9797
$cache->deleteMultiple(array(
98-
'stats.num_products',
99-
'stats.num_users',
98+
'stats.products_count',
99+
'stats.users_count',
100100
));
101101

102102
Available Simple Cache (PSR-16) Classes
@@ -159,22 +159,22 @@ a filesystem-based cache, instantiate :class:`Symfony\\Component\\Cache\\Adapter
159159
Now you can create, retrieve, update and delete items using this cache pool::
160160

161161
// create a new item by trying to get it from the cache
162-
$numProducts = $cache->getItem('stats.num_products');
162+
$productsCount = $cache->getItem('stats.products_count');
163163

164164
// assign a value to the item and save it
165-
$numProducts->set(4711);
166-
$cache->save($numProducts);
165+
$productsCount->set(4711);
166+
$cache->save($productsCount);
167167

168168
// retrieve the cache item
169-
$numProducts = $cache->getItem('stats.num_products');
170-
if (!$numProducts->isHit()) {
169+
$productsCount = $cache->getItem('stats.products_count');
170+
if (!$productsCount->isHit()) {
171171
// ... item does not exists in the cache
172172
}
173173
// retrieve the value stored by the item
174-
$total = $numProducts->get();
174+
$total = $productsCount->get();
175175

176176
// remove the cache item
177-
$cache->deleteItem('stats.num_products');
177+
$cache->deleteItem('stats.products_count');
178178

179179
For a list of all of the supported adapters, see :doc:`/components/cache/cache_pools`.
180180

components/cache/adapters/doctrine_adapter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ third parameters::
2020

2121
$provider = new SQLite3Cache(new \SQLite3(__DIR__.'/cache/data.sqlite'), 'youTableName');
2222

23-
$symfonyCache = new DoctrineAdapter(
23+
$cache = new DoctrineAdapter(
2424

2525
// a cache provider instance
2626
CacheProvider $provider,

components/cache/adapters/php_array_cache_adapter.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ that is optimized and preloaded into OPcache memory storage::
1515
if ($needsWarmup) {
1616
// some static values
1717
$values = array(
18-
'stats.num_products' => 4711,
19-
'stats.num_users' => 1356,
18+
'stats.products_count' => 4711,
19+
'stats.users_count' => 1356,
2020
);
2121

2222
$cache = new PhpArrayAdapter(
@@ -29,7 +29,7 @@ that is optimized and preloaded into OPcache memory storage::
2929
}
3030

3131
// ... then, use the cache!
32-
$cacheItem = $cache->getItem('stats.num_users');
32+
$cacheItem = $cache->getItem('stats.users_count');
3333
echo $cacheItem->get();
3434

3535
.. note::

components/cache/cache_items.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,21 @@ Cache items are created with the ``getItem($key)`` method of the cache pool. The
3131
argument is the key of the item::
3232

3333
// $cache pool object was created before
34-
$numProducts = $cache->getItem('stats.num_products');
34+
$productsCount = $cache->getItem('stats.products_count');
3535

3636
Then, use the :method:`Psr\\Cache\\CacheItemInterface::set` method to set
3737
the data stored in the cache item::
3838

3939
// storing a simple integer
40-
$numProducts->set(4711);
41-
$cache->save($numProducts);
40+
$productsCount->set(4711);
41+
$cache->save($productsCount);
4242

4343
// storing an array
44-
$numProducts->set(array(
44+
$productsCount->set(array(
4545
'category1' => 4711,
4646
'category2' => 2387,
4747
));
48-
$cache->save($numProducts);
48+
$cache->save($productsCount);
4949

5050
The key and the value of any given cache item can be obtained with the
5151
corresponding *getter* methods::

components/filesystem.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,10 @@ The :method:`Symfony\\Component\\Filesystem\\Filesystem::readlink` method provid
222222
by the Filesystem component always behaves in the same way::
223223

224224
// returns the next direct target of the link without considering the existence of the target
225-
$fs->readlink('/path/to/link');
225+
$fileSystem->readlink('/path/to/link');
226226

227227
// returns its absolute fully resolved final version of the target (if there are nested links, they are resolved)
228-
$fs->readlink('/path/to/link', true);
228+
$fileSystem->readlink('/path/to/link', true);
229229

230230
Its behavior is the following::
231231

@@ -297,7 +297,7 @@ appendToFile
297297
:method:`Symfony\\Component\\Filesystem\\Filesystem::appendToFile` adds new
298298
contents at the end of some file::
299299

300-
$fs->appendToFile('logs.txt', 'Email sent to user@example.com');
300+
$fileSystem->appendToFile('logs.txt', 'Email sent to user@example.com');
301301

302302
If either the file or its containing directory doesn't exist, this method
303303
creates them before appending the contents.

components/ldap.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,19 +118,19 @@ delete existing ones::
118118
'objectClass' => array('inetOrgPerson'),
119119
));
120120

121-
$em = $ldap->getEntryManager();
121+
$entityManager = $ldap->getEntryManager();
122122

123123
// Creating a new entry
124-
$em->add($entry);
124+
$entityManager->add($entry);
125125

126126
// Finding and updating an existing entry
127127
$query = $ldap->query('dc=symfony,dc=com', '(&(objectclass=person)(ou=Maintainers))');
128128
$result = $query->execute();
129129
$entry = $result[0];
130130
$entry->setAttribute('email', array('fabpot@symfony.com'));
131-
$em->update($entry);
131+
$entityManager->update($entry);
132132

133133
// Removing an existing entry
134-
$em->remove(new Entry('cn=Test User,dc=symfony,dc=com'));
134+
$entityManager->remove(new Entry('cn=Test User,dc=symfony,dc=com'));
135135

136136
.. _Packagist: https://packagist.org/packages/symfony/ldap

components/routing.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,8 @@ routes with UTF-8 characters:
405405
use Symfony\Component\Routing\RouteCollection;
406406
use Symfony\Component\Routing\Route;
407407
408-
$collection = new RouteCollection();
409-
$collection->add('route1', new Route('/category/{name}',
408+
$routes = new RouteCollection();
409+
$routes->add('route1', new Route('/category/{name}',
410410
array(
411411
'_controller' => 'App\Controller\DefaultController::category',
412412
),
@@ -418,7 +418,7 @@ routes with UTF-8 characters:
418418
419419
// ...
420420
421-
return $collection;
421+
return $routes;
422422
423423
In this route, the ``utf8`` option set to ``true`` makes Symfony consider the
424424
``.`` requirement to match any UTF-8 characters instead of just a single
@@ -482,8 +482,8 @@ You can also include UTF-8 strings as routing requirements:
482482
use Symfony\Component\Routing\RouteCollection;
483483
use Symfony\Component\Routing\Route;
484484
485-
$collection = new RouteCollection();
486-
$collection->add('route2', new Route('/default/{default}',
485+
$routes = new RouteCollection();
486+
$routes->add('route2', new Route('/default/{default}',
487487
array(
488488
'_controller' => 'App\Controller\DefaultController::default',
489489
),
@@ -497,7 +497,7 @@ You can also include UTF-8 strings as routing requirements:
497497
498498
// ...
499499
500-
return $collection;
500+
return $routes;
501501
502502
.. tip::
503503

console/lazy_commands.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ with command names as keys and service identifiers as values::
6868
use Symfony\Component\Console\CommandLoader\ContainerCommandLoader;
6969
use Symfony\Component\DependencyInjection\ContainerBuilder;
7070

71-
$container = new ContainerBuilder();
72-
$container->register(FooCommand::class, FooCommand::class);
73-
$container->compile();
71+
$containerBuilder = new ContainerBuilder();
72+
$containerBuilder->register(FooCommand::class, FooCommand::class);
73+
$containerBuilder->compile();
7474

75-
$commandLoader = new ContainerCommandLoader($container, array(
75+
$commandLoader = new ContainerCommandLoader($containerBuilder, array(
7676
'app:foo' => FooCommand::class,
7777
));
7878

7979
Like this, executing the ``app:foo`` command will load the ``FooCommand`` service
80-
by calling ``$container->get(FooCommand::class)``.
80+
by calling ``$containerBuilder->get(FooCommand::class)``.

contributing/code/reproducer.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,20 @@ Reproducing Complex Bugs
3535
If the bug is related to the Symfony Framework or if it's too complex to create
3636
a PHP script, it's better to reproduce the bug by creating a new project. To do so:
3737

38-
1. Create a new project:
38+
#. Create a new project:
3939

4040
.. code-block:: terminal
4141
4242
$ composer create-project symfony/skeleton bug_app
4343
44-
2. Now you must add the minimum amount of code to reproduce the bug. This is the
44+
#. Add and commit the changes generated by Symfony.
45+
#. Now you must add the minimum amount of code to reproduce the bug. This is the
4546
trickiest part and it's explained a bit more later.
46-
3. Add and commit your changes.
47-
4. Create a `new repository`_ on GitHub (give it any name).
48-
5. Follow the instructions on GitHub to add the ``origin`` remote to your local project
47+
#. Add and commit your changes.
48+
#. Create a `new repository`_ on GitHub (give it any name).
49+
#. Follow the instructions on GitHub to add the ``origin`` remote to your local project
4950
and push it.
50-
6. Add a comment in your original issue report to share the URL of your forked
51+
#. Add a comment in your original issue report to share the URL of your forked
5152
project (e.g. ``https://github.com/YOUR-GITHUB-USERNAME/symfony_issue_23567``)
5253
and, if necessary, explain the steps to reproduce (e.g. "browse this URL",
5354
"fill in this data in the form and submit it", etc.)

event_dispatcher/method_behavior.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ could listen to the ``mailer.post_send`` event and change the method's return va
121121
{
122122
public function onMailerPostSend(AfterSendMailEvent $event)
123123
{
124-
$ret = $event->getReturnValue();
125-
// modify the original ``$ret`` value
124+
$returnValue = $event->getReturnValue();
125+
// modify the original ``$returnValue`` value
126126

127-
$event->setReturnValue($ret);
127+
$event->setReturnValue($returnValue);
128128
}
129129

130130
public static function getSubscribedEvents()

0 commit comments

Comments
 (0)