Skip to content

Commit ce10e67

Browse files
carusogabrielxabbuh
authored andcommitted
Clean up
1 parent 1865baf commit ce10e67

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+112
-143
lines changed

bundles/configuration.rst

-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ bundle configuration would look like:
110110
For parameter handling within a dependency injection container see
111111
:doc:`/configuration/using_parameters_in_dic`.
112112

113-
114113
Processing the ``$configs`` Array
115114
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
116115

@@ -264,7 +263,6 @@ In your extension, you can load this and dynamically set its arguments::
264263
$def->replaceArgument(1, $config['twitter']['client_secret']);
265264
}
266265

267-
268266
.. tip::
269267

270268
Instead of calling ``processConfiguration()`` in your extension each time you

components/asset.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ any versioning::
6666
// Absolute path
6767
echo $package->getUrl('/image.png');
6868
// result: /image.png
69-
69+
7070
// Relative path
7171
echo $package->getUrl('image.png');
7272
// result: image.png
@@ -113,7 +113,7 @@ suffix to any asset path::
113113
// Absolute path
114114
echo $package->getUrl('/image.png');
115115
// result: /image.png?v1
116-
116+
117117
// Relative path
118118
echo $package->getUrl('image.png');
119119
// result: image.png?v1
@@ -132,7 +132,7 @@ string as the second argument of the ``StaticVersionStrategy`` constructor::
132132

133133
echo $package->getUrl('/image.png');
134134
// result: /v1/image.png
135-
135+
136136
echo $package->getUrl('image.png');
137137
// result: v1/image.png
138138

@@ -183,7 +183,7 @@ that path over and over again::
183183

184184
echo $package->getUrl('logo.png');
185185
// result: /static/images/logo.png?v1
186-
186+
187187
// Base path is ignored when using absolute paths
188188
echo $package->getUrl('/logo.png');
189189
// result: /logo.png?v1

components/cache/psr6_psr16_adapters.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ this use-case::
4444

4545
// a PSR-6 cache that uses your cache internally!
4646
$psr6Cache = new SimpleCacheAdapter($psr16Cache);
47-
47+
4848
// now use this wherever you want
4949
$githubApiClient = new GitHubApiClient($psr6Cache);
5050

@@ -81,6 +81,6 @@ this use-case::
8181

8282
// a PSR-16 cache that uses your cache internally!
8383
$psr16Cache = new Psr6Cache($psr6Cache);
84-
84+
8585
// now use this wherever you want
8686
$githubApiClient = new GitHubApiClient($psr16Cache);

components/console/helpers/questionhelper.rst

-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ method::
256256
$name = $helper->ask($input, $output, $question);
257257
}
258258

259-
260259
.. caution::
261260

262261
The normalizer is called first and the returned value is used as the input

components/filesystem.rst

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ The Filesystem Component
66

77
The Filesystem component provides basic utilities for the filesystem.
88

9-
109
Installation
1110
------------
1211

components/http_kernel.rst

-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ This implementation is explained more in the sidebar below::
234234
public function getController(Request $request);
235235
}
236236

237-
238237
Internally, the ``HttpKernel::handle()`` method first calls
239238
:method:`Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface::getController`
240239
on the controller resolver. This method is passed the ``Request`` and is responsible

components/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ The Components
44
.. toctree::
55
:maxdepth: 1
66
:glob:
7-
7+
88
using_components
99
*

components/lock.rst

-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ Locks are created and managed in ``Stores``, which are classes that implement
143143
:class:`Symfony\\Component\\Lock\\StoreInterface`. The component includes the
144144
following built-in store types:
145145

146-
147146
============================================ ====== ======== ========
148147
Store Scope Blocking Expiring
149148
============================================ ====== ======== ========

components/options_resolver.rst

-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,6 @@ is thrown::
376376
For options with more complicated validation schemes, pass a closure which
377377
returns ``true`` for acceptable values and ``false`` for invalid values::
378378

379-
380379
// ...
381380
$resolver->setAllowedValues('transport', function ($value) {
382381
// return true or false

components/phpunit_bridge.rst

-1
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,6 @@ Consider the following example::
493493
}
494494
}
495495

496-
497496
The ``FooTest::test`` method executes every single line of code of both ``Foo``
498497
and ``Bar`` classes, but ``Bar`` is not truly tested. The ``CoverageListener``
499498
aims to fix this behavior by adding the appropriate `@covers`_ annotation on

components/property_access.rst

-1
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,5 @@ Or you can pass parameters directly to the constructor (not the recommended way)
450450
// ...
451451
$accessor = new PropertyAccessor(true); // this enables handling of magic __call
452452

453-
454453
.. _Packagist: https://packagist.org/packages/symfony/property-access
455454
.. _The Inflector component: https://github.com/symfony/inflector

components/routing.rst

-1
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,6 @@ routes with UTF-8 characters:
417417
418418
return $collection;
419419
420-
421420
In this route, the ``utf8`` option set to ``true`` makes Symfony consider the
422421
``.`` requirement to match any UTF-8 characters instead of just a single
423422
byte character. This means that so the following URLs would match:

components/serializer.rst

-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ You can install the component in 2 different ways:
2929
* :doc:`Install it via Composer </components/using_components>` (``symfony/serializer`` on `Packagist`_);
3030
* Use the official Git repository (https://github.com/symfony/serializer).
3131

32-
3332
.. include:: /components/require_autoload.rst.inc
3433

3534
To use the ``ObjectNormalizer``, the :doc:`PropertyAccess component </components/property_access>`
@@ -167,7 +166,6 @@ an exception when additional attributes are passed::
167166
'allow_extra_attributes' => false,
168167
));
169168

170-
171169
Deserializing in an Existing Object
172170
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
173171

components/validator/metadata.rst

+72-72
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,72 @@
1-
.. index::
2-
single: Validator; Metadata
3-
4-
Metadata
5-
========
6-
7-
The :class:`Symfony\\Component\\Validator\\Mapping\\ClassMetadata` class
8-
represents and manages all the configured constraints on a given class.
9-
10-
Properties
11-
----------
12-
13-
The Validator component can validate public, protected or private properties.
14-
The following example shows how to validate that the ``$firstName`` property of
15-
the ``Author`` class has at least 3 characters::
16-
17-
// ...
18-
use Symfony\Component\Validator\Mapping\ClassMetadata;
19-
use Symfony\Component\Validator\Constraints as Assert;
20-
21-
class Author
22-
{
23-
private $firstName;
24-
25-
public static function loadValidatorMetadata(ClassMetadata $metadata)
26-
{
27-
$metadata->addPropertyConstraint('firstName', new Assert\NotBlank());
28-
$metadata->addPropertyConstraint(
29-
'firstName',
30-
new Assert\Length(array("min" => 3))
31-
);
32-
}
33-
}
34-
35-
Getters
36-
-------
37-
38-
Constraints can also be applied to the value returned by any public *getter*
39-
method, which are the methods whose names start with ``get``, ``has`` or ``is``.
40-
This feature allows to validate your objects dynamically.
41-
42-
Suppose that, for security reasons, you want to validate that a password field
43-
doesn't match the first name of the user. First, create a public method called
44-
``isPasswordSafe()`` to define this custom validation logic::
45-
46-
public function isPasswordSafe()
47-
{
48-
return $this->firstName !== $this->password;
49-
}
50-
51-
Then, add the Validator component configuration to the class::
52-
53-
// ...
54-
use Symfony\Component\Validator\Mapping\ClassMetadata;
55-
use Symfony\Component\Validator\Constraints as Assert;
56-
57-
class Author
58-
{
59-
public static function loadValidatorMetadata(ClassMetadata $metadata)
60-
{
61-
$metadata->addGetterConstraint('passwordSafe', new Assert\IsTrue(array(
62-
'message' => 'The password cannot match your first name',
63-
)));
64-
}
65-
}
66-
67-
Classes
68-
-------
69-
70-
Some constraints allow to validate the entire object. For example, the
71-
:doc:`Callback </reference/constraints/Callback>` constraint is a generic
72-
constraint that's applied to the class itself.
1+
.. index::
2+
single: Validator; Metadata
3+
4+
Metadata
5+
========
6+
7+
The :class:`Symfony\\Component\\Validator\\Mapping\\ClassMetadata` class
8+
represents and manages all the configured constraints on a given class.
9+
10+
Properties
11+
----------
12+
13+
The Validator component can validate public, protected or private properties.
14+
The following example shows how to validate that the ``$firstName`` property of
15+
the ``Author`` class has at least 3 characters::
16+
17+
// ...
18+
use Symfony\Component\Validator\Mapping\ClassMetadata;
19+
use Symfony\Component\Validator\Constraints as Assert;
20+
21+
class Author
22+
{
23+
private $firstName;
24+
25+
public static function loadValidatorMetadata(ClassMetadata $metadata)
26+
{
27+
$metadata->addPropertyConstraint('firstName', new Assert\NotBlank());
28+
$metadata->addPropertyConstraint(
29+
'firstName',
30+
new Assert\Length(array("min" => 3))
31+
);
32+
}
33+
}
34+
35+
Getters
36+
-------
37+
38+
Constraints can also be applied to the value returned by any public *getter*
39+
method, which are the methods whose names start with ``get``, ``has`` or ``is``.
40+
This feature allows to validate your objects dynamically.
41+
42+
Suppose that, for security reasons, you want to validate that a password field
43+
doesn't match the first name of the user. First, create a public method called
44+
``isPasswordSafe()`` to define this custom validation logic::
45+
46+
public function isPasswordSafe()
47+
{
48+
return $this->firstName !== $this->password;
49+
}
50+
51+
Then, add the Validator component configuration to the class::
52+
53+
// ...
54+
use Symfony\Component\Validator\Mapping\ClassMetadata;
55+
use Symfony\Component\Validator\Constraints as Assert;
56+
57+
class Author
58+
{
59+
public static function loadValidatorMetadata(ClassMetadata $metadata)
60+
{
61+
$metadata->addGetterConstraint('passwordSafe', new Assert\IsTrue(array(
62+
'message' => 'The password cannot match your first name',
63+
)));
64+
}
65+
}
66+
67+
Classes
68+
-------
69+
70+
Some constraints allow to validate the entire object. For example, the
71+
:doc:`Callback </reference/constraints/Callback>` constraint is a generic
72+
constraint that's applied to the class itself.

components/var_dumper.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ DebugBundle and Twig Integration
8080
--------------------------------
8181

8282
The DebugBundle allows greater integration of this component into Symfony
83-
applications.
83+
applications.
8484

8585
Since generating (even debug) output in the controller or in the model
8686
of your application may just break it by e.g. sending HTTP headers or

configuration/micro_kernel_trait.rst

-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ that define your bundles, your services and your routes:
102102
``RouteCollectionBuilder`` has methods that make adding routes in PHP more
103103
fun. You can also load external routing files (shown below).
104104

105-
106105
Advanced Example: Twig, Annotations and the Web Debug Toolbar
107106
-------------------------------------------------------------
108107

console.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ as a service, you can use normal dependency injection. Imagine you have a
186186
public function __construct(UserManager $userManager)
187187
{
188188
$this->userManager = $userManager;
189-
189+
190190
parent::__construct();
191191
}
192192

console/command_in_controller.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Run this command from inside your controller via::
5555

5656
// return the output, don't use if you used NullOutput()
5757
$content = $output->fetch();
58-
58+
5959
// return new Response(""), if you used NullOutput()
6060
return new Response($content);
6161
}

contributing/code/bugs.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ If your problem definitely looks like a bug, report it using the official bug
2626
* Describe the steps needed to reproduce the bug with short code examples
2727
(providing a unit test that illustrates the bug is best);
2828

29-
* If the bug you experienced is not obvious or affects more than one layer,
30-
providing a simple failing unit test may not be sufficient. In this case,
29+
* If the bug you experienced is not obvious or affects more than one layer,
30+
providing a simple failing unit test may not be sufficient. In this case,
3131
please :doc:`provide a reproducer </contributing/code/reproducer>`;
3232

3333
* Give as much detail as possible about your environment (OS, PHP version,

create_framework/event_dispatcher.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ the registration of a listener for the ``response`` event::
138138

139139
$response->setContent($response->getContent().'GA CODE');
140140
});
141-
141+
142142
$controllerResolver = new ControllerResolver();
143143
$argumentResolver = new ArgumentResolver();
144144

create_framework/front_controller.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ web root directory:
140140
141141
example.com
142142
├── composer.json
143-
├── composer.lock
143+
├── composer.lock
144144
├── src
145145
│ └── pages
146146
│ ├── hello.php

create_framework/http_kernel_controller_resolver.rst

-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ based on a Request object. All controller resolvers implement the following inte
5656
public function getController(Request $request);
5757
}
5858

59-
6059
The ``getController()`` method relies on the same convention as the one we
6160
have defined earlier: the ``_controller`` request attribute must contain the
6261
controller associated with the Request. Besides the built-in PHP callbacks,
@@ -100,7 +99,6 @@ following interface::
10099
public function getArguments(Request $request, $controller);
101100
}
102101

103-
104102
The ``indexAction()`` method needs the Request object as an argument.
105103
``getArguments()`` knows when to inject it properly if it is type-hinted
106104
correctly::

create_framework/http_kernel_httpkernel_class.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ attributes with route parameters.
6868
Our code is now much more concise and surprisingly more robust and more
6969
powerful than ever. For instance, use the built-in ``ExceptionListener`` to
7070
make your error management configurable::
71-
71+
7272
$errorHandler = function (Symfony\Component\Debug\Exception\FlattenException $exception) {
7373
$msg = 'Something went wrong! ('.$exception->getMessage().')';
7474

deployment.rst

-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ specifically tailored to the requirements of Symfony.
103103
`sf2debpkg`_
104104
Helps you build a native Debian package for your Symfony project.
105105

106-
107106
Basic scripting
108107
You can of course use shell, `Ant`_ or any other build tool to script
109108
the deploying of your project.

0 commit comments

Comments
 (0)