Skip to content

Clean up #8953

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

Closed
wants to merge 2 commits into from
Closed
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: 0 additions & 2 deletions bundles/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ bundle configuration would look like:
For parameter handling within a dependency injection container see
:doc:`/configuration/using_parameters_in_dic`.


Processing the ``$configs`` Array
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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


.. tip::

Instead of calling ``processConfiguration()`` in your extension each time you
Expand Down
8 changes: 4 additions & 4 deletions components/asset.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ any versioning::
// Absolute path
echo $package->getUrl('/image.png');
// result: /image.png

// Relative path
echo $package->getUrl('image.png');
// result: image.png
Expand Down Expand Up @@ -113,7 +113,7 @@ suffix to any asset path::
// Absolute path
echo $package->getUrl('/image.png');
// result: /image.png?v1

// Relative path
echo $package->getUrl('image.png');
// result: image.png?v1
Expand All @@ -132,7 +132,7 @@ string as the second argument of the ``StaticVersionStrategy`` constructor::

echo $package->getUrl('/image.png');
// result: /v1/image.png

echo $package->getUrl('image.png');
// result: v1/image.png

Expand Down Expand Up @@ -183,7 +183,7 @@ that path over and over again::

echo $package->getUrl('logo.png');
// result: /static/images/logo.png?v1

// Base path is ignored when using absolute paths
echo $package->getUrl('/logo.png');
// result: /logo.png?v1
Expand Down
4 changes: 2 additions & 2 deletions components/cache/psr6_psr16_adapters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ this use-case::

// a PSR-6 cache that uses your cache internally!
$psr6Cache = new SimpleCacheAdapter($psr16Cache);

// now use this wherever you want
$githubApiClient = new GitHubApiClient($psr6Cache);

Expand Down Expand Up @@ -81,6 +81,6 @@ this use-case::

// a PSR-16 cache that uses your cache internally!
$psr16Cache = new Psr6Cache($psr6Cache);

// now use this wherever you want
$githubApiClient = new GitHubApiClient($psr16Cache);
1 change: 0 additions & 1 deletion components/console/helpers/questionhelper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ method::
$name = $helper->ask($input, $output, $question);
}


.. caution::

The normalizer is called first and the returned value is used as the input
Expand Down
1 change: 0 additions & 1 deletion components/filesystem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ The Filesystem Component

The Filesystem component provides basic utilities for the filesystem.


Installation
------------

Expand Down
1 change: 0 additions & 1 deletion components/http_kernel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ This implementation is explained more in the sidebar below::
public function getController(Request $request);
}


Internally, the ``HttpKernel::handle()`` method first calls
:method:`Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface::getController`
on the controller resolver. This method is passed the ``Request`` and is responsible
Expand Down
2 changes: 1 addition & 1 deletion components/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ The Components
.. toctree::
:maxdepth: 1
:glob:

using_components
*
1 change: 0 additions & 1 deletion components/lock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ Locks are created and managed in ``Stores``, which are classes that implement
:class:`Symfony\\Component\\Lock\\StoreInterface`. The component includes the
following built-in store types:


============================================ ====== ======== ========
Store Scope Blocking Expiring
============================================ ====== ======== ========
Expand Down
1 change: 0 additions & 1 deletion components/options_resolver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,6 @@ is thrown::
For options with more complicated validation schemes, pass a closure which
returns ``true`` for acceptable values and ``false`` for invalid values::


// ...
$resolver->setAllowedValues('transport', function ($value) {
// return true or false
Expand Down
1 change: 0 additions & 1 deletion components/phpunit_bridge.rst
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,6 @@ Consider the following example::
}
}


The ``FooTest::test`` method executes every single line of code of both ``Foo``
and ``Bar`` classes, but ``Bar`` is not truly tested. The ``CoverageListener``
aims to fix this behavior by adding the appropriate `@covers`_ annotation on
Expand Down
1 change: 0 additions & 1 deletion components/property_access.rst
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,5 @@ Or you can pass parameters directly to the constructor (not the recommended way)
// ...
$accessor = new PropertyAccessor(true); // this enables handling of magic __call


.. _Packagist: https://packagist.org/packages/symfony/property-access
.. _The Inflector component: https://github.com/symfony/inflector
1 change: 0 additions & 1 deletion components/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,6 @@ routes with UTF-8 characters:

return $collection;


In this route, the ``utf8`` option set to ``true`` makes Symfony consider the
``.`` requirement to match any UTF-8 characters instead of just a single
byte character. This means that so the following URLs would match:
Expand Down
2 changes: 0 additions & 2 deletions components/serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ You can install the component in 2 different ways:
* :doc:`Install it via Composer </components/using_components>` (``symfony/serializer`` on `Packagist`_);
* Use the official Git repository (https://github.com/symfony/serializer).


.. include:: /components/require_autoload.rst.inc

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


Deserializing in an Existing Object
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
144 changes: 72 additions & 72 deletions components/validator/metadata.rst
Original file line number Diff line number Diff line change
@@ -1,72 +1,72 @@
.. index::
single: Validator; Metadata
Metadata
========
The :class:`Symfony\\Component\\Validator\\Mapping\\ClassMetadata` class
represents and manages all the configured constraints on a given class.
Properties
----------
The Validator component can validate public, protected or private properties.
The following example shows how to validate that the ``$firstName`` property of
the ``Author`` class has at least 3 characters::
// ...
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
class Author
{
private $firstName;
public static function loadValidatorMetadata(ClassMetadata $metadata)
{
$metadata->addPropertyConstraint('firstName', new Assert\NotBlank());
$metadata->addPropertyConstraint(
'firstName',
new Assert\Length(array("min" => 3))
);
}
}
Getters
-------
Constraints can also be applied to the value returned by any public *getter*
method, which are the methods whose names start with ``get``, ``has`` or ``is``.
This feature allows to validate your objects dynamically.
Suppose that, for security reasons, you want to validate that a password field
doesn't match the first name of the user. First, create a public method called
``isPasswordSafe()`` to define this custom validation logic::
public function isPasswordSafe()
{
return $this->firstName !== $this->password;
}
Then, add the Validator component configuration to the class::
// ...
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
class Author
{
public static function loadValidatorMetadata(ClassMetadata $metadata)
{
$metadata->addGetterConstraint('passwordSafe', new Assert\IsTrue(array(
'message' => 'The password cannot match your first name',
)));
}
}
Classes
-------
Some constraints allow to validate the entire object. For example, the
:doc:`Callback </reference/constraints/Callback>` constraint is a generic
constraint that's applied to the class itself.
.. index::
single: Validator; Metadata

Metadata
========

The :class:`Symfony\\Component\\Validator\\Mapping\\ClassMetadata` class
represents and manages all the configured constraints on a given class.

Properties
----------

The Validator component can validate public, protected or private properties.
The following example shows how to validate that the ``$firstName`` property of
the ``Author`` class has at least 3 characters::

// ...
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;

class Author
{
private $firstName;

public static function loadValidatorMetadata(ClassMetadata $metadata)
{
$metadata->addPropertyConstraint('firstName', new Assert\NotBlank());
$metadata->addPropertyConstraint(
'firstName',
new Assert\Length(array("min" => 3))
);
}
}

Getters
-------

Constraints can also be applied to the value returned by any public *getter*
method, which are the methods whose names start with ``get``, ``has`` or ``is``.
This feature allows to validate your objects dynamically.

Suppose that, for security reasons, you want to validate that a password field
doesn't match the first name of the user. First, create a public method called
``isPasswordSafe()`` to define this custom validation logic::

public function isPasswordSafe()
{
return $this->firstName !== $this->password;
}

Then, add the Validator component configuration to the class::

// ...
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;

class Author
{
public static function loadValidatorMetadata(ClassMetadata $metadata)
{
$metadata->addGetterConstraint('passwordSafe', new Assert\IsTrue(array(
'message' => 'The password cannot match your first name',
)));
}
}

Classes
-------

Some constraints allow to validate the entire object. For example, the
:doc:`Callback </reference/constraints/Callback>` constraint is a generic
constraint that's applied to the class itself.
2 changes: 1 addition & 1 deletion components/var_dumper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ DebugBundle and Twig Integration
--------------------------------

The DebugBundle allows greater integration of this component into Symfony
applications.
applications.

Since generating (even debug) output in the controller or in the model
of your application may just break it by e.g. sending HTTP headers or
Expand Down
1 change: 0 additions & 1 deletion configuration/micro_kernel_trait.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ that define your bundles, your services and your routes:
``RouteCollectionBuilder`` has methods that make adding routes in PHP more
fun. You can also load external routing files (shown below).


Advanced Example: Twig, Annotations and the Web Debug Toolbar
-------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion console.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ as a service, you can use normal dependency injection. Imagine you have a
public function __construct(UserManager $userManager)
{
$this->userManager = $userManager;

parent::__construct();
}

Expand Down
2 changes: 1 addition & 1 deletion console/command_in_controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Run this command from inside your controller via::

// return the output, don't use if you used NullOutput()
$content = $output->fetch();

// return new Response(""), if you used NullOutput()
return new Response($content);
}
Expand Down
4 changes: 2 additions & 2 deletions contributing/code/bugs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ If your problem definitely looks like a bug, report it using the official bug
* Describe the steps needed to reproduce the bug with short code examples
(providing a unit test that illustrates the bug is best);

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

* Give as much detail as possible about your environment (OS, PHP version,
Expand Down
2 changes: 1 addition & 1 deletion create_framework/event_dispatcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ the registration of a listener for the ``response`` event::

$response->setContent($response->getContent().'GA CODE');
});

$controllerResolver = new ControllerResolver();
$argumentResolver = new ArgumentResolver();

Expand Down
2 changes: 1 addition & 1 deletion create_framework/front_controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ web root directory:

example.com
├── composer.json
├── composer.lock
├── composer.lock
├── src
│ └── pages
│ ├── hello.php
Expand Down
2 changes: 0 additions & 2 deletions create_framework/http_kernel_controller_resolver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ based on a Request object. All controller resolvers implement the following inte
public function getController(Request $request);
}


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


The ``indexAction()`` method needs the Request object as an argument.
``getArguments()`` knows when to inject it properly if it is type-hinted
correctly::
Expand Down
2 changes: 1 addition & 1 deletion create_framework/http_kernel_httpkernel_class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ attributes with route parameters.
Our code is now much more concise and surprisingly more robust and more
powerful than ever. For instance, use the built-in ``ExceptionListener`` to
make your error management configurable::

$errorHandler = function (Symfony\Component\Debug\Exception\FlattenException $exception) {
$msg = 'Something went wrong! ('.$exception->getMessage().')';

Expand Down
1 change: 0 additions & 1 deletion deployment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ specifically tailored to the requirements of Symfony.
`sf2debpkg`_
Helps you build a native Debian package for your Symfony project.


Basic scripting
You can of course use shell, `Ant`_ or any other build tool to script
the deploying of your project.
Expand Down
Loading