Skip to content

Commit 6132796

Browse files
committed
Merge branch '4.2'
* 4.2: fix indention
2 parents a5f3e42 + 2be18a3 commit 6132796

File tree

23 files changed

+130
-129
lines changed

23 files changed

+130
-129
lines changed

bundles/configuration.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ can add some configuration that looks like this:
7171
xsi:schemaLocation="http://symfony.com/schema/dic/services
7272
https://symfony.com/schema/dic/services/services-1.0.xsd">
7373
74-
<acme-social:config>
75-
<acme-social:twitter client-id="123" client-secret="your_secret"/>
76-
</acme-social:config>
74+
<acme-social:config>
75+
<acme-social:twitter client-id="123" client-secret="your_secret"/>
76+
</acme-social:config>
7777
78-
<!-- ... -->
78+
<!-- ... -->
7979
</container>
8080
8181
.. code-block:: php

components/cache/adapters/proxy_adapter.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ and optionally a namespace and default cache lifetime as its second and third pa
1818
use Psr\Cache\CacheItemPoolInterface;
1919
use Symfony\Component\Cache\Adapter\ProxyAdapter;
2020

21-
$psr6CachePool = \\ create your own cache pool instance that implements the PSR-6
22-
\\ interface `CacheItemPoolInterface`
21+
\\ create your own cache pool instance that implements the PSR-6
22+
\\ interface `CacheItemPoolInterface`
23+
$psr6CachePool = ...
2324

2425
$cache = new ProxyAdapter(
2526

components/console/console_arguments.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Have a look at the following command that has three options::
3939

4040
protected function execute(InputInterface $input, OutputInterface $output)
4141
{
42-
// ...
42+
// ...
4343
}
4444
}
4545

components/console/single_command_tool.rst

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,44 +8,44 @@ When building a command line tool, you may not need to provide several commands.
88
In such case, having to pass the command name each time is tedious. Fortunately,
99
it is possible to remove this need by declaring a single command application::
1010

11-
#!/usr/bin/env php
12-
<?php
13-
require __DIR__.'/vendor/autoload.php';
14-
15-
use Symfony\Component\Console\Application;
16-
use Symfony\Component\Console\Input\InputArgument;
17-
use Symfony\Component\Console\Input\InputInterface;
18-
use Symfony\Component\Console\Input\InputOption;
19-
use Symfony\Component\Console\Output\OutputInterface;
20-
21-
(new Application('echo', '1.0.0'))
22-
->register('echo')
23-
->addArgument('foo', InputArgument::OPTIONAL, 'The directory')
24-
->addOption('bar', null, InputOption::VALUE_REQUIRED)
25-
->setCode(function(InputInterface $input, OutputInterface $output) {
26-
// output arguments and options
27-
})
28-
->getApplication()
29-
->setDefaultCommand('echo', true) // Single command application
30-
->run();
11+
#!/usr/bin/env php
12+
<?php
13+
require __DIR__.'/vendor/autoload.php';
14+
15+
use Symfony\Component\Console\Application;
16+
use Symfony\Component\Console\Input\InputArgument;
17+
use Symfony\Component\Console\Input\InputInterface;
18+
use Symfony\Component\Console\Input\InputOption;
19+
use Symfony\Component\Console\Output\OutputInterface;
20+
21+
(new Application('echo', '1.0.0'))
22+
->register('echo')
23+
->addArgument('foo', InputArgument::OPTIONAL, 'The directory')
24+
->addOption('bar', null, InputOption::VALUE_REQUIRED)
25+
->setCode(function(InputInterface $input, OutputInterface $output) {
26+
// output arguments and options
27+
})
28+
->getApplication()
29+
->setDefaultCommand('echo', true) // Single command application
30+
->run();
3131

3232
The method :method:`Symfony\\Component\\Console\\Application::setDefaultCommand`
3333
accepts a boolean as second parameter. If true, the command ``echo`` will then
3434
always be used, without having to pass its name.
3535

3636
You can still register a command as usual::
3737

38-
#!/usr/bin/env php
39-
<?php
40-
require __DIR__.'/vendor/autoload.php';
38+
#!/usr/bin/env php
39+
<?php
40+
require __DIR__.'/vendor/autoload.php';
4141

42-
use Acme\Command\DefaultCommand;
43-
use Symfony\Component\Console\Application;
42+
use Acme\Command\DefaultCommand;
43+
use Symfony\Component\Console\Application;
4444

45-
$application = new Application('echo', '1.0.0');
46-
$command = new DefaultCommand();
45+
$application = new Application('echo', '1.0.0');
46+
$command = new DefaultCommand();
4747

48-
$application->add($command);
48+
$application->add($command);
4949

50-
$application->setDefaultCommand($command->getName(), true);
51-
$application->run();
50+
$application->setDefaultCommand($command->getName(), true);
51+
$application->run();

components/dependency_injection/compilation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ compilation::
325325
{
326326
public function process(ContainerBuilder $container)
327327
{
328-
// ... do something during the compilation
328+
// ... do something during the compilation
329329
}
330330

331331
// ...
@@ -379,7 +379,7 @@ class implementing the ``CompilerPassInterface``::
379379
{
380380
public function process(ContainerBuilder $container)
381381
{
382-
// ... do something during the compilation
382+
// ... do something during the compilation
383383
}
384384
}
385385

components/dom_crawler.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ context of the crawler::
262262
// DO THIS: specify the parent tag too
263263
$subCrawler = $parentCrawler->filterXPath('parent/sub-tag/sub-child-tag');
264264
$subCrawler = $parentCrawler->filterXPath('node()/sub-tag/sub-child-tag');
265-
});
265+
});
266266

267267
Adding the Content
268268
~~~~~~~~~~~~~~~~~~
@@ -363,30 +363,30 @@ This behavior is best illustrated with examples::
363363

364364
$crawler->filterXPath('//span[contains(@id, "article-")]')->evaluate('substring-after(@id, "-")');
365365
/* array:3 [
366-
0 => "100"
367-
1 => "101"
368-
2 => "102"
369-
]
366+
0 => "100",
367+
1 => "101",
368+
2 => "102",
369+
]
370370
*/
371371

372372
$crawler->evaluate('substring-after(//span[contains(@id, "article-")]/@id, "-")');
373373
/* array:1 [
374-
0 => "100"
375-
]
374+
0 => "100",
375+
]
376376
*/
377377

378378
$crawler->filterXPath('//span[@class="article"]')->evaluate('count(@id)');
379379
/* array:3 [
380-
0 => 1.0
381-
1 => 1.0
382-
2 => 1.0
383-
]
380+
0 => 1.0,
381+
1 => 1.0,
382+
2 => 1.0,
383+
]
384384
*/
385385

386386
$crawler->evaluate('count(//span[@class="article"])');
387387
/* array:1 [
388-
0 => 3.0
389-
]
388+
0 => 3.0,
389+
]
390390
*/
391391

392392
$crawler->evaluate('//span[1]');

components/serializer.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,11 +1048,11 @@ because it is deeper than the configured maximum depth of 2::
10481048
$result = [
10491049
'foo' => 'level1',
10501050
'child' => [
1051-
'foo' => 'level2',
1052-
'child' => [
1053-
'child' => null,
1054-
],
1051+
'foo' => 'level2',
1052+
'child' => [
1053+
'child' => null,
10551054
],
1055+
],
10561056
];
10571057
*/
10581058

@@ -1310,7 +1310,7 @@ parameter of the ``ObjectNormalizer``::
13101310

13111311
$obj = $serializer->denormalize(
13121312
['inner' => ['foo' => 'foo', 'bar' => 'bar'], 'date' => '1988/01/21'],
1313-
'Acme\ObjectOuter'
1313+
'Acme\ObjectOuter'
13141314
);
13151315

13161316
dump($obj->getInner()->foo); // 'foo'

components/web_link.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ Usage
2222

2323
The following example shows the component in action::
2424

25-
use Fig\Link\GenericLinkProvider;
26-
use Fig\Link\Link;
27-
use Symfony\Component\WebLink\HttpHeaderSerializer;
25+
use Fig\Link\GenericLinkProvider;
26+
use Fig\Link\Link;
27+
use Symfony\Component\WebLink\HttpHeaderSerializer;
2828

29-
$linkProvider = (new GenericLinkProvider())
30-
->withLink(new Link('preload', '/bootstrap.min.css'));
29+
$linkProvider = (new GenericLinkProvider())
30+
->withLink(new Link('preload', '/bootstrap.min.css'));
3131

32-
header('Link: '.(new HttpHeaderSerializer())->serialize($linkProvider->getLinks()));
32+
header('Link: '.(new HttpHeaderSerializer())->serialize($linkProvider->getLinks()));
3333

34-
echo 'Hello';
34+
echo 'Hello';
3535

3636
Read the full :doc:`WebLink documentation </web_link>` to learn about all the
3737
features of the component and its integration with the Symfony framework.

configuration/environment_variables.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ whenever the corresponding environment variable is *not* found:
9090
<parameters>
9191
<parameter key="env(DATABASE_HOST)">localhost</parameter>
9292
</parameters>
93-
</container>
93+
</container>
9494
9595
.. code-block:: php
9696

console/commands_as_services.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Or set the ``command`` attribute on the ``console.command`` tag in your service
104104
105105
<services>
106106
<service id="App\Command\SunshineCommand">
107-
<tag name="console.command" command="app:sunshine"/>
107+
<tag name="console.command" command="app:sunshine"/>
108108
</service>
109109
</services>
110110
</container>

create_framework/routing.rst

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -95,25 +95,25 @@ The ``match()`` method takes a request path and returns an array of attributes
9595

9696
print_r($matcher->match('/bye'));
9797
/* Gives:
98-
array (
99-
'_route' => 'bye',
100-
);
98+
[
99+
'_route' => 'bye',
100+
];
101101
*/
102102

103103
print_r($matcher->match('/hello/Fabien'));
104104
/* Gives:
105-
array (
106-
'name' => 'Fabien',
107-
'_route' => 'hello',
108-
);
105+
[
106+
'name' => 'Fabien',
107+
'_route' => 'hello',
108+
];
109109
*/
110110

111111
print_r($matcher->match('/hello'));
112112
/* Gives:
113-
array (
114-
'name' => 'World',
115-
'_route' => 'hello',
116-
);
113+
[
114+
'name' => 'World',
115+
'_route' => 'hello',
116+
];
117117
*/
118118

119119
.. note::
@@ -165,23 +165,23 @@ There are a few new things in the code:
165165

166166
* Request attributes are extracted to keep our templates simple::
167167

168-
<!-- example.com/src/pages/hello.php -->
169-
Hello <?= htmlspecialchars($name, ENT_QUOTES, 'UTF-8') ?>
168+
// example.com/src/pages/hello.php
169+
Hello <?= htmlspecialchars($name, ENT_QUOTES, 'UTF-8') ?>
170170

171171
* Route configuration has been moved to its own file::
172172

173-
// example.com/src/app.php
174-
use Symfony\Component\Routing;
173+
// example.com/src/app.php
174+
use Symfony\Component\Routing;
175175

176-
$routes = new Routing\RouteCollection();
177-
$routes->add('hello', new Routing\Route('/hello/{name}', ['name' => 'World']));
178-
$routes->add('bye', new Routing\Route('/bye'));
176+
$routes = new Routing\RouteCollection();
177+
$routes->add('hello', new Routing\Route('/hello/{name}', ['name' => 'World']));
178+
$routes->add('bye', new Routing\Route('/bye'));
179179

180-
return $routes;
180+
return $routes;
181181

182-
We now have a clear separation between the configuration (everything
183-
specific to our application in ``app.php``) and the framework (the generic
184-
code that powers our application in ``front.php``).
182+
We now have a clear separation between the configuration (everything
183+
specific to our application in ``app.php``) and the framework (the generic
184+
code that powers our application in ``front.php``).
185185

186186
With less than 30 lines of code, we have a new framework, more powerful and
187187
more flexible than the previous one. Enjoy!

doctrine/dbal.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ mapping type:
127127
# config/packages/doctrine.yaml
128128
doctrine:
129129
dbal:
130-
mapping_types:
131-
enum: string
130+
mapping_types:
131+
enum: string
132132
133133
.. code-block:: xml
134134
@@ -143,7 +143,7 @@ mapping type:
143143
144144
<doctrine:config>
145145
<doctrine:dbal>
146-
<doctrine:mapping-type name="enum">string</doctrine:mapping-type>
146+
<doctrine:mapping-type name="enum">string</doctrine:mapping-type>
147147
</doctrine:dbal>
148148
</doctrine:config>
149149
</container>
@@ -153,9 +153,9 @@ mapping type:
153153
// config/packages/doctrine.php
154154
$container->loadFromExtension('doctrine', [
155155
'dbal' => [
156-
'mapping_types' => [
157-
'enum' => 'string',
158-
],
156+
'mapping_types' => [
157+
'enum' => 'string',
158+
],
159159
],
160160
]);
161161

email/dev_environment.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ by adding the ``delivery_whitelist`` option:
140140
swiftmailer:
141141
delivery_addresses: ['dev@example.com']
142142
delivery_whitelist:
143-
# all email addresses matching these regexes will be delivered
144-
# like normal, as well as being sent to dev@example.com
145-
- '/@specialdomain\.com$/'
146-
- '/^admin@mydomain\.com$/'
143+
# all email addresses matching these regexes will be delivered
144+
# like normal, as well as being sent to dev@example.com
145+
- '/@specialdomain\.com$/'
146+
- '/^admin@mydomain\.com$/'
147147
148148
.. code-block:: xml
149149

email/spool.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ this spool, use the following configuration:
5353
5454
// config/packages/swiftmailer.php
5555
$container->loadFromExtension('swiftmailer', [
56-
// ...
56+
// ...
5757
'spool' => ['type' => 'memory'],
5858
]);
5959
@@ -103,7 +103,7 @@ In order to use the spool with files, use the following configuration:
103103
104104
// config/packages/swiftmailer.php
105105
$container->loadFromExtension('swiftmailer', [
106-
// ...
106+
// ...
107107
108108
'spool' => [
109109
'type' => 'file',

reference/configuration/doctrine.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ can be placed directly under ``doctrine.orm`` config level.
194194
orm:
195195
# ...
196196
query_cache_driver:
197-
# ...
197+
# ...
198198
metadata_cache_driver:
199199
# ...
200200
result_cache_driver:

0 commit comments

Comments
 (0)