Skip to content

Commit

Permalink
Merge branch '6.0' into 6.1
Browse files Browse the repository at this point in the history
* 6.0:
  [Contributing] [Code] Add a step for forking in "Proposing a Change"
  Bump Symfony version
  Fix invalid yaml for password hashing in test env
  Update confusing first class callable syntax
  • Loading branch information
javiereguiluz committed Dec 26, 2022
2 parents f3b5b38 + 43da79d commit c8946c2
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 32 deletions.
2 changes: 1 addition & 1 deletion components/validator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ If you have lots of validation errors, you can filter them by error code::

use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;

$violations = $validator->validate(...);
$violations = $validator->validate(/* ... */);
if (0 !== count($violations->findByCodes(UniqueEntity::NOT_UNIQUE_ERROR))) {
// handle this specific error (display some message, send an email, etc.)
}
Expand Down
2 changes: 2 additions & 0 deletions contributing/code/pull_requests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ Get the Symfony source code:

* Fork the `Symfony repository`_ (click on the "Fork" button);

* Uncheck the "Copy the ``X.Y`` branch only";

* After the "forking action" has completed, clone your fork locally
(this will create a ``symfony`` directory):

Expand Down
16 changes: 8 additions & 8 deletions contributing/documentation/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,16 @@ memorable name for the new branch (if you are fixing a reported issue, use

.. code-block:: terminal
$ git checkout -b improve_install_article upstream/4.4
$ git checkout -b improve_install_article upstream/5.4
In this example, the name of the branch is ``improve_install_article`` and the
``upstream/4.4`` value tells Git to create this branch based on the ``4.4``
``upstream/5.4`` value tells Git to create this branch based on the ``5.4``
branch of the ``upstream`` remote, which is the original Symfony Docs repository.

Fixes should always be based on the **oldest maintained branch** which contains
the error. Nowadays this is the ``4.4`` branch. If you are instead documenting a
the error. Nowadays this is the ``5.4`` branch. If you are instead documenting a
new feature, switch to the first Symfony version that included it, e.g.
``upstream/5.4``.
``upstream/6.2``.

**Step 5.** Now make your changes in the documentation. Add, tweak, reword and
even remove any content and do your best to comply with the
Expand Down Expand Up @@ -155,7 +155,7 @@ changes should be applied:
:align: center

In this example, the **base fork** should be ``symfony/symfony-docs`` and
the **base** branch should be the ``4.4``, which is the branch that you selected
the **base** branch should be the ``5.4``, which is the branch that you selected
to base your changes on. The **head fork** should be your forked copy
of ``symfony-docs`` and the **compare** branch should be ``improve_install_article``,
which is the name of the branch you created and where you made your changes.
Expand Down Expand Up @@ -205,7 +205,7 @@ contribution to the Symfony docs:
# create a new branch based on the oldest maintained version
$ cd projects/symfony-docs/
$ git fetch upstream
$ git checkout -b my_changes upstream/4.4
$ git checkout -b my_changes upstream/5.4
# ... do your changes
Expand Down Expand Up @@ -254,8 +254,8 @@ into multiple branches, corresponding to the different versions of Symfony itsel
The latest (e.g. ``5.x``) branch holds the documentation for the development branch of
the code.

Unless you're documenting a feature that was introduced after Symfony 4.4,
your changes should always be based on the ``4.4`` branch. Documentation managers
Unless you're documenting a feature that was introduced after Symfony 5.4,
your changes should always be based on the ``5.4`` branch. Documentation managers
will use the necessary Git-magic to also apply your changes to all the active
branches of the documentation.

Expand Down
6 changes: 3 additions & 3 deletions controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ special type of exception::
// throw new NotFoundHttpException('The product does not exist');
}

return $this->render(...);
return $this->render(/* ... */);
}

The :method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController::createNotFoundException`
Expand Down Expand Up @@ -435,10 +435,10 @@ For example, imagine you're processing a :doc:`form </forms>` submission::
);
// $this->addFlash() is equivalent to $request->getSession()->getFlashBag()->add()

return $this->redirectToRoute(...);
return $this->redirectToRoute(/* ... */);
}

return $this->render(...);
return $this->render(/* ... */);
}

After processing the request, the controller sets a flash message in the session
Expand Down
2 changes: 1 addition & 1 deletion form/data_transformers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ slightly::
$builder->add(
$builder
->create('tags', TextType::class)
->addModelTransformer(...)
->addModelTransformer(/* ... */)
);

Example #2: Transforming an Issue Number into an Issue Entity
Expand Down
2 changes: 1 addition & 1 deletion form/validation_groups.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ this as an option when :ref:`creating forms in controllers <creating-forms-in-co

$form = $this->createFormBuilder($user, [
'validation_groups' => ['registration'],
])->add(...);
])->add(/* ... */);

When :ref:`creating forms in classes <creating-forms-in-classes>`, add the
following to the ``configureOptions()`` method::
Expand Down
2 changes: 1 addition & 1 deletion http_client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ that network errors can happen when calling e.g. ``getStatusCode()`` too::
// ...
try {
// both lines can potentially throw
$response = $client->request(...);
$response = $client->request(/* ... */);
$headers = $response->getHeaders();
// ...
} catch (TransportExceptionInterface $e) {
Expand Down
2 changes: 1 addition & 1 deletion logging/monolog_exclude_http_codes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ logging these HTTP codes based on the MonologBundle configuration:
$mainHandler = $monolog->handler('main')
// ...
->type('fingers_crossed')
->handler(...)
->handler('...')
;
$mainHandler->excludedHttpCode()->code(403);
Expand Down
6 changes: 3 additions & 3 deletions messenger.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1813,7 +1813,7 @@ this globally (or for each transport) to a service that implements
->context('foo', 'bar');
$messenger->transport('async_priority_normal')
->dsn(...)
->dsn('...')
->serializer('messenger.transport.symfony_serializer');
};
Expand Down Expand Up @@ -2071,8 +2071,8 @@ Then, make sure to "route" your message to *both* transports:
return static function (FrameworkConfig $framework) {
$messenger = $framework->messenger();
$messenger->transport('async_priority_normal')->dsn(...);
$messenger->transport('image_transport')->dsn(...);
$messenger->transport('async_priority_normal')->dsn('...');
$messenger->transport('image_transport')->dsn('...');
$messenger->routing('App\Message\UploadedImage')
->senders(['image_transport', 'async_priority_normal']);
Expand Down
27 changes: 15 additions & 12 deletions security/passwords.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,22 @@ Further in this article, you can find a
.. configuration-block::

.. code-block:: yaml
# config/packages/test/security.yaml
password_hashers:
# Use your user class name here
App\Entity\User:
algorithm: plaintext # disable hashing (only do this in tests!)
# or use the lowest possible values
App\Entity\User:
algorithm: auto # This should be the same value as in config/packages/security.yaml
cost: 4 # Lowest possible value for bcrypt
time_cost: 3 # Lowest possible value for argon
memory_cost: 10 # Lowest possible value for argon
security:
# ...
password_hashers:
# Use your user class name here
App\Entity\User:
algorithm: plaintext # disable hashing (only do this in tests!)
# or use the lowest possible values
App\Entity\User:
algorithm: auto # This should be the same value as in config/packages/security.yaml
cost: 4 # Lowest possible value for bcrypt
time_cost: 3 # Lowest possible value for argon
memory_cost: 10 # Lowest possible value for argon
.. code-block:: xml
Expand Down
2 changes: 1 addition & 1 deletion testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ the container is returned by ``static::getContainer()``::

// (3) run some service & test the result
$newsletterGenerator = $container->get(NewsletterGenerator::class);
$newsletter = $newsletterGenerator->generateMonthlyNews(...);
$newsletter = $newsletterGenerator->generateMonthlyNews(/* ... */);

$this->assertEquals('...', $newsletter->getContent());
}
Expand Down

0 comments on commit c8946c2

Please sign in to comment.