Skip to content

fix indention #11504

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
Apr 30, 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
2 changes: 1 addition & 1 deletion best_practices/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ view layer:
{{ form_widget(form) }}

<input type="submit" value="Create"
class="btn btn-default pull-right"/>
class="btn btn-default pull-right"/>
{{ form_end(form) }}

Validation
Expand Down
8 changes: 4 additions & 4 deletions bundles/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ allow users to configure it with some configuration that looks like this:
xsi:schemaLocation="http://symfony.com/schema/dic/services
https://symfony.com/schema/dic/services/services-1.0.xsd">

<acme-social:config>
<acme-social:twitter client-id="123" client-secret="your_secret"/>
</acme-social:config>
<acme-social:config>
<acme-social:twitter client-id="123" client-secret="your_secret"/>
</acme-social:config>

<!-- ... -->
<!-- ... -->
</container>

.. code-block:: php
Expand Down
2 changes: 1 addition & 1 deletion components/cache/adapters/pdo_doctrine_dbal_adapter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PDO & Doctrine DBAL Cache Adapter

.. versionadded:: 3.2

The PDO & Doctrine DBAL adapter was introduced in Symfony 3.2.
The PDO & Doctrine DBAL adapter was introduced in Symfony 3.2.

This adapter stores the cache items in an SQL database. It requires a `PDO`_,
`Doctrine DBAL Connection`_, or `Data Source Name (DSN)`_ as its first parameter, and
Expand Down
5 changes: 3 additions & 2 deletions components/cache/adapters/proxy_adapter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ and optionally a namespace and default cache lifetime as its second and third pa
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\Cache\Adapter\ProxyAdapter;

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

$cache = new ProxyAdapter(

Expand Down
2 changes: 1 addition & 1 deletion components/console/console_arguments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Have a look at the following command that has three options::

protected function execute(InputInterface $input, OutputInterface $output)
{
// ...
// ...
}
}

Expand Down
60 changes: 30 additions & 30 deletions components/console/single_command_tool.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,44 @@ When building a command line tool, you may not need to provide several commands.
In such case, having to pass the command name each time is tedious. Fortunately,
it is possible to remove this need by declaring a single command application::

#!/usr/bin/env php
<?php
require __DIR__.'/vendor/autoload.php';

use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

(new Application('echo', '1.0.0'))
->register('echo')
->addArgument('foo', InputArgument::OPTIONAL, 'The directory')
->addOption('bar', null, InputOption::VALUE_REQUIRED)
->setCode(function(InputInterface $input, OutputInterface $output) {
// output arguments and options
})
->getApplication()
->setDefaultCommand('echo', true) // Single command application
->run();
#!/usr/bin/env php
<?php
require __DIR__.'/vendor/autoload.php';

use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

(new Application('echo', '1.0.0'))
->register('echo')
->addArgument('foo', InputArgument::OPTIONAL, 'The directory')
->addOption('bar', null, InputOption::VALUE_REQUIRED)
->setCode(function(InputInterface $input, OutputInterface $output) {
// output arguments and options
})
->getApplication()
->setDefaultCommand('echo', true) // Single command application
->run();

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

Of course, you can still register a command as usual::

#!/usr/bin/env php
<?php
require __DIR__.'/vendor/autoload.php';
#!/usr/bin/env php
<?php
require __DIR__.'/vendor/autoload.php';

use Acme\Command\DefaultCommand;
use Symfony\Component\Console\Application;
use Acme\Command\DefaultCommand;
use Symfony\Component\Console\Application;

$application = new Application('echo', '1.0.0');
$command = new DefaultCommand();
$application = new Application('echo', '1.0.0');
$command = new DefaultCommand();

$application->add($command);
$application->add($command);

$application->setDefaultCommand($command->getName(), true);
$application->run();
$application->setDefaultCommand($command->getName(), true);
$application->run();
4 changes: 2 additions & 2 deletions components/dependency_injection/compilation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ compilation::
{
public function process(ContainerBuilder $container)
{
// ... do something during the compilation
// ... do something during the compilation
}

// ...
Expand Down Expand Up @@ -379,7 +379,7 @@ class implementing the ``CompilerPassInterface``::
{
public function process(ContainerBuilder $container)
{
// ... do something during the compilation
// ... do something during the compilation
}
}

Expand Down
26 changes: 13 additions & 13 deletions components/dom_crawler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ context of the crawler::
// DO THIS: specify the parent tag too
$subCrawler = $parentCrawler->filterXPath('parent/sub-tag/sub-child-tag');
$subCrawler = $parentCrawler->filterXPath('node()/sub-tag/sub-child-tag');
});
});

Adding the Content
~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -338,30 +338,30 @@ This behavior is best illustrated with examples::

$crawler->filterXPath('//span[contains(@id, "article-")]')->evaluate('substring-after(@id, "-")');
/* array:3 [
0 => "100"
1 => "101"
2 => "102"
]
0 => "100",
1 => "101",
2 => "102",
]
*/

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

$crawler->filterXPath('//span[@class="article"]')->evaluate('count(@id)');
/* array:3 [
0 => 1.0
1 => 1.0
2 => 1.0
]
0 => 1.0,
1 => 1.0,
2 => 1.0,
]
*/

$crawler->evaluate('count(//span[@class="article"])');
/* array:1 [
0 => 3.0
]
0 => 3.0,
]
*/

$crawler->evaluate('//span[1]');
Expand Down
2 changes: 1 addition & 1 deletion components/filesystem/lock_handler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ PHP code will wait indefinitely until the lock is released by another process.

use Symfony\Component\Filesystem\LockHandler;

if (!(new LockHandler('hello.lock'))->lock()) {
if (!(new LockHandler('hello.lock'))->lock()) {
// the resource "hello" is already locked by another process

return 0;
Expand Down
10 changes: 5 additions & 5 deletions components/serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -856,11 +856,11 @@ because it is deeper than the configured maximum depth of 2::
$result = [
'foo' => 'level1',
'child' => [
'foo' => 'level2',
'child' => [
'child' => null,
],
'foo' => 'level2',
'child' => [
'child' => null,
],
],
];
*/

Expand Down Expand Up @@ -1031,7 +1031,7 @@ parameter of the ``ObjectNormalizer``::

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

dump($obj->getInner()->foo); // 'foo'
Expand Down
14 changes: 7 additions & 7 deletions components/web_link.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ Usage

The following example shows the component in action::

use Fig\Link\GenericLinkProvider;
use Fig\Link\Link;
use Symfony\Component\WebLink\HttpHeaderSerializer;
use Fig\Link\GenericLinkProvider;
use Fig\Link\Link;
use Symfony\Component\WebLink\HttpHeaderSerializer;

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

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

echo 'Hello';
echo 'Hello';

Read the full :doc:`WebLink documentation </web_link>` to learn about all the
features of the component and its integration with the Symfony framework.
Expand Down
6 changes: 3 additions & 3 deletions configuration/environments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ this code and changing the environment string.
.. code-block:: yaml

doctrine:
dbal:
logging: '%kernel.debug%'
# ...
dbal:
logging: '%kernel.debug%'
# ...

.. code-block:: xml

Expand Down
2 changes: 1 addition & 1 deletion configuration/external_parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ will be used whenever the corresponding environment variable is *not* found:
<parameter key="database_host">%env(DATABASE_HOST)%</parameter>
<parameter key="env(DATABASE_HOST)">localhost</parameter>
</parameters>
</container>
</container>

.. code-block:: php

Expand Down
2 changes: 1 addition & 1 deletion console/commands_as_services.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Or set the ``command`` attribute on the ``console.command`` tag in your service
<services>

<service id="AppBundle\Command\SunshineCommand">
<tag name="console.command" command="app:sunshine"/>
<tag name="console.command" command="app:sunshine"/>
</service>

</services>
Expand Down
44 changes: 22 additions & 22 deletions create_framework/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,25 +95,25 @@ The ``match()`` method takes a request path and returns an array of attributes

print_r($matcher->match('/bye'));
/* Gives:
array (
'_route' => 'bye',
);
[
'_route' => 'bye',
];
*/

print_r($matcher->match('/hello/Fabien'));
/* Gives:
array (
'name' => 'Fabien',
'_route' => 'hello',
);
[
'name' => 'Fabien',
'_route' => 'hello',
];
*/

print_r($matcher->match('/hello'));
/* Gives:
array (
'name' => 'World',
'_route' => 'hello',
);
[
'name' => 'World',
'_route' => 'hello',
];
*/

.. note::
Expand Down Expand Up @@ -165,23 +165,23 @@ There are a few new things in the code:

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

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

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

// example.com/src/app.php
use Symfony\Component\Routing;
// example.com/src/app.php
use Symfony\Component\Routing;

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

return $routes;
return $routes;

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

With less than 30 lines of code, we have a new framework, more powerful and
more flexible than the previous one. Enjoy!
Expand Down
12 changes: 6 additions & 6 deletions doctrine/dbal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ mapping type:
# app/config/config.yml
doctrine:
dbal:
mapping_types:
enum: string
mapping_types:
enum: string

.. code-block:: xml

Expand All @@ -180,7 +180,7 @@ mapping type:

<doctrine:config>
<doctrine:dbal>
<doctrine:mapping-type name="enum">string</doctrine:mapping-type>
<doctrine:mapping-type name="enum">string</doctrine:mapping-type>
</doctrine:dbal>
</doctrine:config>
</container>
Expand All @@ -190,9 +190,9 @@ mapping type:
// app/config/config.php
$container->loadFromExtension('doctrine', [
'dbal' => [
'mapping_types' => [
'enum' => 'string',
],
'mapping_types' => [
'enum' => 'string',
],
],
]);

Expand Down
Loading