Skip to content

Commit

Permalink
Merge branch '6.4' into 7.0
Browse files Browse the repository at this point in the history
* 6.4:
  [RFC] Add alt texts to images
  • Loading branch information
wouterj committed Sep 1, 2023
2 parents 3b26e4c + f471484 commit 565af2b
Show file tree
Hide file tree
Showing 74 changed files with 4,264 additions and 280 deletions.
Binary file modified _images/contributing/docs-github-edit-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed _images/doctrine/mapping_relations.png
Binary file not shown.
602 changes: 602 additions & 0 deletions _images/doctrine/mapping_relations.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed _images/doctrine/mapping_relations_proxy.png
Binary file not shown.
926 changes: 926 additions & 0 deletions _images/doctrine/mapping_relations_proxy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed _images/doctrine/mapping_single_entity.png
Binary file not shown.
469 changes: 469 additions & 0 deletions _images/doctrine/mapping_single_entity.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed _images/form/data-transformer-types.png
Binary file not shown.
178 changes: 178 additions & 0 deletions _images/form/data-transformer-types.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
305 changes: 252 additions & 53 deletions _images/form/form_prepopulation_workflow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
408 changes: 333 additions & 75 deletions _images/form/form_submission_workflow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
327 changes: 262 additions & 65 deletions _images/form/form_workflow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed _images/http/xkcd-full.png
Binary file not shown.
324 changes: 324 additions & 0 deletions _images/http/xkcd-full.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed _images/http/xkcd-request.png
Binary file not shown.
191 changes: 191 additions & 0 deletions _images/http/xkcd-request.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed _images/mercure/discovery.png
Binary file not shown.
294 changes: 294 additions & 0 deletions _images/mercure/discovery.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
196 changes: 196 additions & 0 deletions _images/mercure/hub.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed _images/mercure/schema.png
Binary file not shown.
4 changes: 3 additions & 1 deletion _images/sources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ Use the following snippet to embed the diagram in the docs:
```
.. raw:: html
<object data="../_images/<folder-name>/<diagram-file-name>.svg" type="image/svg+xml"></object>
<object data="../_images/<folder-name>/<diagram-file-name>.svg" type="image/svg+xml"
alt="<alt description>"
></object>
```

### Reasoning
Expand Down
Binary file added _images/sources/doctrine/mapping_relations.dia
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added _images/sources/form/data-transformer-types.dia
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added _images/sources/form/form_workflow.dia
Binary file not shown.
Binary file added _images/sources/http/xkcd-full.dia
Binary file not shown.
Binary file added _images/sources/http/xkcd-request.dia
Binary file not shown.
Binary file added _images/sources/mercure/discovery.dia
Binary file not shown.
Binary file added _images/sources/mercure/hub.dia
Binary file not shown.
2 changes: 1 addition & 1 deletion components/console/helpers/cursor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cursor position in a console command. This allows you to write on any position
of the output:

.. image:: /_images/components/console/cursor.gif
:align: center
:alt: A command outputs on various positions on the screen, eventually drawing the letters "SF".

.. code-block:: php
Expand Down
2 changes: 1 addition & 1 deletion components/console/helpers/debug_formatter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ the results of running ``figlet symfony``, it might output something like
this:

.. image:: /_images/components/console/debug_formatter.png
:align: center
:alt: Console output, with the first line showing "RUN Running figlet", followed by lines showing the output of the command prefixed with "OUT" and "RES Finished the command" as last line in the output.

Using the debug_formatter
-------------------------
Expand Down
3 changes: 3 additions & 0 deletions components/console/helpers/processhelper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@ a very verbose verbosity (e.g. ``-vv``)::
will result in this output:

.. image:: /_images/components/console/process-helper-verbose.png
:alt: Console output showing two lines: "RUN 'figlet' 'Symfony'" and "RES Command ran successfully".

It will result in more detailed output with debug verbosity (e.g. ``-vvv``):

.. image:: /_images/components/console/process-helper-debug.png
:alt: In between the command line and the result line, the command's output is now shown prefixed by "OUT".

In case the process fails, debugging is easier:

.. image:: /_images/components/console/process-helper-error-debug.png
:alt: The last line shows "RES 127 Command dit not run successfully", and the output lines show more the error information from the command.

Arguments
---------
Expand Down
1 change: 1 addition & 0 deletions components/console/helpers/progressbar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ When executing longer-running commands, it may be helpful to show progress
information, which updates as your command runs:

.. image:: /_images/components/console/progressbar.gif
:alt: Console output showing a progress bar advance to 100%, with the esimated time left, the memory usage and a special message that changes when the bar closes completion.

.. note::

Expand Down
2 changes: 1 addition & 1 deletion components/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ done by passing a special form "view" object to your template (notice the
{{ form_end(form) }}

.. image:: /_images/form/simple-form.png
:align: center
:alt: An HTML form showing a text box labelled "Task", three select boxes for a year, month and day labelled "Due date" and a button labelled "Create Task".

That's it! By printing ``form_widget(form)``, each field in the form is
rendered, along with a label and error message (if there is one). While this is
Expand Down
12 changes: 9 additions & 3 deletions components/http_kernel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ and ends with a :class:`Symfony\\Component\\HttpFoundation\\Response`.

.. raw:: html

<object data="../_images/components/http_kernel/http-workflow.svg" type="image/svg+xml"></object>
<object data="../_images/components/http_kernel/http-workflow.svg" type="image/svg+xml"
alt="A flow diagram showing all HTTP Kernel events in the Request-Response lifecycle. Each event is numbered 1 to 8 and described in detail in the following subsections."
></object>

The exact details of this workflow are the key to understanding how the kernel
(and the Symfony Framework or any other library that uses the kernel) works.
Expand Down Expand Up @@ -511,7 +513,9 @@ to the exception.

.. raw:: html

<object data="../_images/components/http_kernel/http-workflow-exception.svg" type="image/svg+xml"></object>
<object data="../_images/components/http_kernel/http-workflow-exception.svg" type="image/svg+xml"
alt="The HTTP KErnel flow diagram showing how exceptions bypass all further steps and are directly transformed to responses."
></object>

Each listener to this event is passed a :class:`Symfony\\Component\\HttpKernel\\Event\\ExceptionEvent`
object, which you can use to access the original exception via the
Expand Down Expand Up @@ -670,7 +674,9 @@ your controller).

.. raw:: html

<object data="../_images/components/http_kernel/http-workflow-subrequest.svg" type="image/svg+xml"></object>
<object data="../_images/components/http_kernel/http-workflow-subrequest.svg" type="image/svg+xml"
alt="The HTTP Kernel flow diagram with a sub request from a controller starting the lifecycle at step 1 again and feeding the sub Response content back into the controller."
></object>

To execute a sub request, use ``HttpKernel::handle()``, but change the second
argument as follows::
Expand Down
4 changes: 3 additions & 1 deletion components/messenger.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ Concepts

.. raw:: html

<object data="../_images/components/messenger/overview.svg" type="image/svg+xml"></object>
<object data="../_images/components/messenger/overview.svg" type="image/svg+xml"
alt="A flow diagram visualizing how each concept relates to eachother. Each concept is described in the subsequent text."
></object>

**Sender**:
Responsible for serializing and sending messages to *something*. This
Expand Down
23 changes: 14 additions & 9 deletions components/serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@ In order to do so, the Serializer component follows the following schema.

.. raw:: html

<object data="../_images/components/serializer/serializer_workflow.svg" type="image/svg+xml"></object>

As you can see in the picture above, an array is used as an intermediary between
objects and serialized contents. This way, encoders will only deal with turning
specific **formats** into **arrays** and vice versa. The same way, Normalizers
will deal with turning specific **objects** into **arrays** and vice versa.

Serialization is a complex topic. This component may not cover all your use cases out of the box,
but it can be useful for developing tools to serialize and deserialize your objects.
<object data="../_images/components/serializer/serializer_workflow.svg" type="image/svg+xml"
alt="A flow diagram showing how objects are serialized/deserialized. This is described in the subsequent paragraph."
></object>

When (de)serializing objects, the Serializer uses an array as the intermediary
between objects and serialized contents. Encoders will only deal with
turning specific **formats** into **arrays** and vice versa. The same way,
normalizers will deal with turning specific **objects** into **arrays** and
vice versa. The Serializer deals with calling the normalizers and encoders
when serializing objects or deserializing formats.

Serialization is a complex topic. This component may not cover all your use
cases out of the box, but it can be useful for developing tools to
serialize and deserialize your objects.

Installation
------------
Expand Down
2 changes: 1 addition & 1 deletion components/string.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The following image displays the bytes, code points and grapheme clusters for
the same word written in English (``hello``) and Hindi (``नमस्ते``):

.. image:: /_images/components/string/bytes-points-graphemes.png
:align: center
:alt: Each letter in "hello" is made up of one byte, one code point and one grapheme cluster. In the Hindi translation, the first two letters ("नम") take up three bytes, one code point and one grapheme cluster. The last letters ("स्ते") each take up six bytes, two code points and one grapheme cluster.

Usage
-----
Expand Down
9 changes: 9 additions & 0 deletions components/var_dumper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ then its dump representation::
dump($var);

.. image:: /_images/components/var_dumper/01-simple.png
:alt: Dump output showing the array with length five and all keys and values.

.. note::

Expand All @@ -367,6 +368,7 @@ then its dump representation::
dump($var);
.. image:: /_images/components/var_dumper/02-multi-line-str.png
:alt: Dump output showing the string on multiple lines in between three quotes.

.. code-block:: php
Expand All @@ -381,6 +383,7 @@ then its dump representation::
dump($var);
.. image:: /_images/components/var_dumper/03-object.png
:alt: Dump output showing the PropertyExample object and all three properties with their values.

.. note::

Expand All @@ -399,6 +402,7 @@ then its dump representation::
dump($var);
.. image:: /_images/components/var_dumper/04-dynamic-property.png
:alt: Dump output showing the DynamicPropertyExample object and both declared and undeclared properties with their values.

.. code-block:: php
Expand All @@ -411,6 +415,7 @@ then its dump representation::
dump($var);
.. image:: /_images/components/var_dumper/05-soft-ref.png
:alt: Dump output showing the "aCircularReference" property value referencing the parent object, instead of showing all properties again.

.. code-block:: php
Expand All @@ -424,6 +429,7 @@ then its dump representation::
dump($var);
.. image:: /_images/components/var_dumper/06-constants.png
:alt: Dump output with the "E_WARNING" constant shown as value of "severity".

.. code-block:: php
Expand All @@ -437,6 +443,7 @@ then its dump representation::
dump($var);
.. image:: /_images/components/var_dumper/07-hard-ref.png
:alt: Dump output showing the referenced arrays.

.. code-block:: php
Expand All @@ -447,6 +454,7 @@ then its dump representation::
dump($var);
.. image:: /_images/components/var_dumper/08-virtual-property.png
:alt: Dump output of the ArrayObject.

.. code-block:: php
Expand All @@ -460,6 +468,7 @@ then its dump representation::
dump($var);
.. image:: /_images/components/var_dumper/09-cut.png
:alt: Dump output where the children of the Container object are hidden.

.. code-block:: php
Expand Down
1 change: 1 addition & 0 deletions components/workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ process is called a *place*. You do also define *transitions* that describe
the action to get from one place to another.

.. image:: /_images/components/workflow/states_transitions.png
:alt: An example state diagram for a workflow, showing transitions and places.

A set of places and transitions creates a **definition**. A workflow needs
a ``Definition`` and a way to write the states to the objects (i.e. an
Expand Down
1 change: 1 addition & 0 deletions console.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ terminal. All commands support name and option completion, and some can
even complete values.

.. image:: /_images/components/console/completion.gif
:alt: The terminal completes the command name "secrets:remove" and the argument "SOME_OTHER_SECRET".

First, you have to install the completion script *once*. Run
``bin/console completion --help`` for the installation instructions for
Expand Down
8 changes: 4 additions & 4 deletions contributing/code/stack_trace.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ Several things need to be paid attention to when picking a stack trace
from your development environment through a web browser:

1. Are there several exceptions? If yes, the most interesting one is
often exception 1/n which, is shown *last* in the example below (it
is the one marked as an exception [1/2]).
often exception 1/n which, is shown *last* in the default exception page
(it is the one marked as ``exception [1/2]`` in the below example).
2. Under the "Stack Traces" tab, you will find exceptions in plain
text, so that you can easily share them in e.g. bug reports. Make
sure to **remove any sensitive information** before doing so.
Expand All @@ -102,8 +102,8 @@ from your development environment through a web browser:
are getting, but are not what the term "stack trace" refers to.

.. image:: /_images/contributing/code/stack-trace.gif
:align: center
:class: with-browser
:alt: The default Symfony exception page with the "Exceptions", "Logs" and "Stack Traces" tabs.
:class: with-browser

Since stack traces may contain sensitive data, they should not be
exposed in production. Getting a stack trace from your production
Expand Down
10 changes: 5 additions & 5 deletions contributing/documentation/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ while you're reading the Symfony documentation.
and you'll be redirected to GitHub:

.. image:: /_images/contributing/docs-github-edit-page.png
:align: center
:class: with-browser
:alt: The "Edit this page" button is located directly below the first heading.
:class: with-browser

**Step 2.** Edit the contents, describe your changes and click on the
**Propose file change** button.
Expand All @@ -36,8 +36,8 @@ and you'll be redirected to GitHub:
also display a preview of your changes:

.. image:: /_images/contributing/docs-github-create-pr.png
:align: center
:class: with-browser
:alt: The "Comparing changes" page on GitHub.
:class: with-browser

If everything is correct, click on the **Create pull request** button.

Expand Down Expand Up @@ -152,7 +152,7 @@ exact changes that you want to propose, select the appropriate branches where
changes should be applied:

.. image:: /_images/contributing/docs-pull-request-change-base.png
:align: center
:alt: The base branch select option on the GitHub page.

In this example, the **base fork** should be ``symfony/symfony-docs`` and
the **base** branch should be the ``5.4``, which is the branch that you selected
Expand Down
32 changes: 32 additions & 0 deletions contributing/documentation/standards.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,36 @@ Files and Directories
├─ vendor/
└─ ...
Images and Diagrams
-------------------

* **Diagrams** must adhere to the Symfony docs style. These are created
using the Dia_ application, to make sure everyone can edit them. See the
`README on GitHub`_ for instructions on how to create them.
* All images and diagrams must contain **alt descriptions**:

* Keep the descriptions concise, do not duplicate information surrounding
the figure;
* Describe complex diagrams in text surrounding the diagram instead of
the alt description. In these cases, alt descriptions must describe
where the longer description can be found (e.g. "These elements are
described further in the next sections");
* Start descriptions with a capital letter and end with a period;
* Do not start with "A screenshot of", "Diagram of", etc. except when
it's useful to know the exact type (e.g. a specific diagram type).

.. code-block:: text
.. image:: _images/example-screenshot.png
:alt: Some concise description of the screenshot.
.. raw:: html
<object data="_images/example-diagram.svg" type="image/svg+xml"
alt="Some concise description."
></object>
English Language Standards
--------------------------

Expand Down Expand Up @@ -201,4 +231,6 @@ In addition, documentation follows these rules:
.. _`American English Oxford Dictionary`: https://www.lexico.com/definition/american_english
.. _`headings and titles`: https://en.wikipedia.org/wiki/Letter_case#Headings_and_publication_titles
.. _`Serial (Oxford) Commas`: https://en.wikipedia.org/wiki/Serial_comma
.. _`Dia`: http://dia-installer.de/
.. _`README on GitHub`: https://github.com/symfony/symfony-docs/blob/6.4/_images/sources/README.md
.. _`nosism`: https://en.wikipedia.org/wiki/Nosism
10 changes: 4 additions & 6 deletions controller/error_pages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,16 @@ Symfony catches all the exceptions and displays a special **exception page**
with lots of debug information to help you discover the root problem:

.. image:: /_images/controller/error_pages/exceptions-in-dev-environment.png
:alt: A typical exception page in the development environment
:align: center
:class: with-browser
:alt: A typical exception page in the development environment with the full stacktrace and log information.
:class: with-browser

Since these pages contain a lot of sensitive internal information, Symfony won't
display them in the production environment. Instead, it'll show a minimal and
generic **error page**:

.. image:: /_images/controller/error_pages/errors-in-prod-environment.png
:alt: A typical error page in the production environment
:align: center
:class: with-browser
:alt: A typical error page in the production environment.
:class: with-browser

Error pages for the production environment can be customized in different ways
depending on your needs:
Expand Down
11 changes: 7 additions & 4 deletions doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,11 @@ objects to a ``product`` table in your database. Each property in the ``Product`
entity can be mapped to a column in that table. This is usually done with attributes:
the ``#[ORM\Column(...)]`` comments that you see above each property:

.. image:: /_images/doctrine/mapping_single_entity.png
:align: center
.. raw:: html

<object data="../_images/doctrine/mapping_single_entity.svg" type="image/svg+xml"
alt="Doctrine mapping between properties of a Product PHP object and the data in the product database table"
></object>

The ``make:entity`` command is a tool to make life easier. But this is *your* code:
add/remove fields, add/remove methods or update configuration.
Expand Down Expand Up @@ -589,8 +592,8 @@ the :ref:`doctrine-queries` section.
will display the number of queries and the time it took to execute them:

.. image:: /_images/doctrine/doctrine_web_debug_toolbar.png
:align: center
:class: with-browser
:alt: The web dev toolbar showing the Doctrine item.
:class: with-browser

If the number of database queries is too high, the icon will turn yellow to
indicate that something may not be correct. Click on the icon to open the
Expand Down
Loading

0 comments on commit 565af2b

Please sign in to comment.