Skip to content

Commit 3583a4c

Browse files
noniagriconomiewouterj
authored andcommitted
[Workflow] config doc
1 parent 775f22b commit 3583a4c

File tree

256 files changed

+7802
-5256
lines changed

Some content is hidden

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

256 files changed

+7802
-5256
lines changed

.github/CODEOWNERS

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Console
2+
/console* @chalasr
3+
/components/console* @chalasr
4+
5+
# Form
6+
/forms.rst @xabbuh
7+
/components/form* @xabbuh
8+
/reference/forms* @xabbuh
9+
10+
# PropertyInfo
11+
/components/property_info* @dunglas
12+
13+
# Security
14+
/security* @chalasr
15+
/components/security* @chalasr
16+
17+
# Validator
18+
/validation/*
19+
/components/validator* @xabbuh
20+
/reference/constraints* @xabbuh
21+
22+
# Workflow
23+
/workflow* @lyrixx
24+
/components/workflow* @lyrixx
25+
26+
# Yaml
27+
/components/yaml* @xabbuh

_build/_themes/_exts/symfonycom/sphinx/lexer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class TerminalLexer(RegexLexer):
1010
tokens = {
1111
'root': [
1212
('^\$', Generic.Prompt, 'bash-prompt'),
13-
('^[^\n>]+>', Generic.Prompt, 'dos-prompt'),
13+
('^>', Generic.Prompt, 'dos-prompt'),
1414
('^#.+$', Comment.Single),
1515
('^.+$', Generic.Output),
1616
],

_build/maintainer_guide.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ interface. Then:
9393
Merging Process
9494
~~~~~~~~~~~~~~~
9595

96-
At first it's common to make mistakes and merge things badly. Don't worry. This
96+
At first, it's common to make mistakes and merge things badly. Don't worry. This
9797
has happened to all of us and we've always been able to recover from any mistake.
9898

9999
Step 1: Select the right branch to merge
@@ -120,8 +120,8 @@ Step 2: Merge the pull request
120120
Never use GitHub's web interface (or desktop clients) to merge PRs or to solve
121121
merge conflicts. Always use the ``gh`` tool for anything related to merges.
122122

123-
We require 2 approval votes from team members before merging a PR, except if
124-
it's a typo, a small change or an obvious error.
123+
We require two approval votes from team members before merging a PR, except if
124+
it's a typo, a small change or clearly an error.
125125

126126
If a PR contains lots of commits, there's no need to ask the contributor to
127127
squash them. The ``gh`` tool does that automatically. The only exceptions are

_build/redirection_map

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,3 +417,15 @@
417417
/workflow/state-machines /workflow/introduction
418418
/workflow/usage /workflow
419419
/introduction/from_flat_php_to_symfony2 /introduction/from_flat_php_to_symfony
420+
/configuration/environment_variables /configuration/env_var_processors
421+
/configuration/configuration_organization /configuration
422+
/configuration/environments /configuration
423+
/configuration/configuration_organization /configuration
424+
/email/dev_environment /mailer
425+
/email/spool /mailer
426+
/email/testing /mailer
427+
/contributing/community/other /contributing/community
428+
/profiler/storage /profiler
429+
/setup/composer /setup
430+
/security/security_checker /setup
431+
/service_container/parameters /configuration
181 Bytes
Loading
Loading

_images/form/form-custom-type-postal-address-fragment-names.svg

Lines changed: 1 addition & 0 deletions
Loading

_images/form/form-custom-type-postal-address.svg

Lines changed: 1 addition & 0 deletions
Loading

_images/sources/README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
How to Create Symfony Diagrams
2+
==============================
3+
4+
Creating the Diagram
5+
--------------------
6+
7+
* Use [Dia][1] as the diagramming application;
8+
* Use [PT Sans Narrow][2] as the only font in all diagrams (if possible, use
9+
only the "normal" weight for all contents);
10+
* Use 36pt as the base font size;
11+
* Use 0.10 cm width for lines and shape borders;
12+
* Use the following color palette:
13+
* Text, lines and shape borders: black (#000000)
14+
* Shape backgrounds:
15+
* Grays: dark (#4d4d4d), medium (#b3b3b3), light (#f2f2f2)
16+
* Blue: #b2d4eb
17+
* Red: #ecbec0
18+
* Green: #b2dec7
19+
* Orange: #fddfbb
20+
21+
In case of doubt, check the existing diagrams or ask to the
22+
[Symfony Documentation Team][3].
23+
24+
Saving and Exporting the Diagram
25+
--------------------------------
26+
27+
* Save the original diagram in `*.dia` format in `_images/sources/<folder-name>`;
28+
* Export the diagram to SVG format and save it in `_images/<folder-name>`.
29+
30+
Including the Diagram in the Symfony Docs
31+
-----------------------------------------
32+
33+
Use the following snippet to embed the diagram in the docs:
34+
35+
```
36+
.. raw:: html
37+
38+
<object data="../_images/<folder-name>/<diagram-file-name>.svg" type="image/svg+xml"></object>
39+
```
40+
41+
Reasoning
42+
---------
43+
44+
* Dia was chosen because it's one of the few applications which are free, open
45+
source and compatible with Linux, macOS and Windows.
46+
* Font, colors and line widths were chosen to be similar to the diagrams used
47+
in the best tech books.
48+
49+
Troubleshooting
50+
---------------
51+
52+
* On some macOS systems, Dia cannot be executed as a regular application and
53+
you must run the following console command instead:
54+
`export DISPLAY=:0 && /Applications/Dia.app/Contents/Resources/bin/dia`
55+
56+
[1]: http://dia-installer.de/
57+
[2]: https://fonts.google.com/specimen/PT+Sans+Narrow
58+
[3]: https://symfony.com/doc/current/contributing/code/core_team.html
Binary file not shown.
Binary file not shown.

best_practices/business-logic.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ distributed among developers, with a slight preference towards YAML.
109109
Both formats have the same performance, so this is ultimately a matter of
110110
personal taste.
111111

112-
We recommend YAML because it's friendly to newcomers and concise. You can
113-
use any of the other formats if you prefer another format.
112+
We recommend YAML because it's friendly to newcomers and concise, but you can
113+
use whatever format you like.
114114

115115
Using a Persistence Layer
116116
-------------------------
@@ -235,7 +235,7 @@ the following command to install the Doctrine fixtures bundle:
235235

236236
.. code-block:: terminal
237237
238-
$ composer require doctrine/doctrine-fixtures-bundle
238+
$ composer require --dev doctrine/doctrine-fixtures-bundle
239239
240240
Then, this bundle is enabled automatically, but only for the ``dev`` and
241241
``test`` environments::

best_practices/configuration.rst

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ application behavior.
1616
.. best-practice::
1717

1818
Define the infrastructure-related configuration options as
19-
:doc:`environment variables </configuration/environment_variables>`. During
20-
development, use the ``.env`` and ``.env.local`` files at the root of your
21-
project to set these.
19+
:ref:`environment variables <config-env-vars>`. During development, use the
20+
``.env`` and ``.env.local`` files at the root of your project to set these.
2221

2322
By default, Symfony adds these types of options to the ``.env`` file when
2423
installing new dependencies in the app:
@@ -84,7 +83,7 @@ layer of configuration that's not needed because you don't need or want these
8483
configuration values to change on each server.
8584

8685
The configuration options defined in the ``services.yaml`` may vary from one
87-
:doc:`environment </configuration/environments>` to another. That's why Symfony
86+
:ref:`environment <configuration-environments>` to another. That's why Symfony
8887
supports defining ``config/services_dev.yaml`` and ``config/services_prod.yaml``
8988
files so that you can override specific values for each environment.
9089

@@ -138,8 +137,8 @@ Constants can be used for example in your Twig templates thanks to the
138137
Displaying the {{ constant('NUMBER_OF_ITEMS', post) }} most recent results.
139138
</p>
140139

141-
And Doctrine entities and repositories can now easily access these values,
142-
whereas they cannot access the container parameters::
140+
And Doctrine entities and repositories can access these values too, whereas they
141+
cannot access the container parameters::
143142

144143
namespace App\Repository;
145144

@@ -155,7 +154,7 @@ whereas they cannot access the container parameters::
155154
}
156155

157156
The only notable disadvantage of using constants for this kind of configuration
158-
values is that you cannot redefine them easily in your tests.
157+
values is that it's complicated to redefine their values in your tests.
159158

160159
Parameter Naming
161160
----------------

best_practices/controllers.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ The ``@Template`` annotation is useful, but also involves some magic. We
8989
don't think its benefit is worth the magic, and so recommend against using
9090
it.
9191

92-
Most of the time, ``@Template`` is used without any parameters, which makes
93-
it more difficult to know which template is being rendered. It also makes
94-
it less obvious to beginners that a controller should always return a Response
95-
object (unless you're using a view layer).
92+
Most of the time, ``@Template`` is used without any parameters, which makes it
93+
more difficult to know which template is being rendered. It also hides the fact
94+
that a controller should always return a Response object (unless you're using a
95+
view layer).
9696

9797
What does the Controller look like
9898
----------------------------------

best_practices/introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ that fit the philosophy of the framework as envisioned by its original creator
2525

2626
.. note::
2727

28-
**Best practice** is a noun that means *"a well defined procedure that is
28+
**Best practice** is a noun that means *"a well-defined procedure that is
2929
known to produce near-optimum results"*. And that's exactly what this
3030
guide aims to provide. Even if you don't agree with every recommendation,
3131
we believe these will help you build great applications with less complexity.

best_practices/security.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ primarily under the ``firewalls`` key.
1818
API only), we recommend having only *one* firewall entry with the ``anonymous``
1919
key enabled.
2020

21-
Most applications only have one authentication system and one set of users.
22-
For this reason, you only need *one* firewall entry. There are exceptions
23-
of course, especially if you have separated web and API sections on your
24-
site. But the point is to keep things simple.
21+
Most applications only have one authentication system and one set of users. For
22+
this reason, you only need *one* firewall entry. If you have separated web and
23+
API sections on your site, you will need more firewall entries. But the point is
24+
to keep things simple.
2525

2626
Additionally, you should use the ``anonymous`` key under your firewall. If
2727
you need to require users to be logged in for different sections of your

best_practices/templates.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,4 @@ be used as a Twig extension.
119119
Next: :doc:`/best_practices/forms`
120120

121121
.. _`Twig`: https://twig.symfony.com/
122-
.. _`Parsedown`: http://parsedown.org/
122+
.. _`Parsedown`: https://parsedown.org/

best_practices/tests.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ The built-in functional testing client is great, but it can't be used to
106106
test any JavaScript behavior on your pages. If you need to test this, consider
107107
using the `Mink`_ library from within PHPUnit.
108108

109-
Of course, if you have a heavy JavaScript front-end, you should consider using
110-
pure JavaScript-based testing tools.
109+
If you have a heavy JavaScript frontend, you should consider using pure
110+
JavaScript-based testing tools.
111111

112112
Learn More about Functional Tests
113113
---------------------------------

bundles.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ SecurityBundle, DebugBundle, etc.) They are also used to add new features in
1818
your application via `third-party bundles`_.
1919

2020
Bundles used in your applications must be enabled per
21-
:doc:`environment </configuration/environments>` in the ``config/bundles.php``
21+
:ref:`environment <configuration-environments>` in the ``config/bundles.php``
2222
file::
2323

2424
// config/bundles.php

bundles/best_practices.rst

Lines changed: 12 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ of Symfony and the latest beta release:
197197
include:
198198
# Minimum supported dependencies with the latest and oldest PHP version
199199
- php: 7.2
200-
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak_vendors"
200+
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="max[self]=0"
201201
- php: 7.0
202-
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak_vendors"
202+
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="max[self]=0"
203203
204204
# Test the latest stable release
205205
- php: 7.0
@@ -306,26 +306,15 @@ following standardized instructions in your ``README.md`` file.
306306
### Step 2: Enable the Bundle
307307
308308
Then, enable the bundle by adding it to the list of registered bundles
309-
in the `app/AppKernel.php` file of your project:
309+
in the `config/bundles.php` file of your project:
310310
311311
```php
312-
// app/AppKernel.php
313-
314-
// ...
315-
class AppKernel extends Kernel
316-
{
317-
public function registerBundles()
318-
{
319-
$bundles = [
320-
// ...
321-
new <vendor>\<bundle-name>\<bundle-long-name>(),
322-
];
323-
324-
// ...
325-
}
312+
// config/bundles.php
326313
314+
return [
327315
// ...
328-
}
316+
<vendor>\<bundle-name>\<bundle-long-name>::class => ['all' => true],
317+
];
329318
```
330319
331320
.. code-block:: rst
@@ -362,26 +351,13 @@ following standardized instructions in your ``README.md`` file.
362351
~~~~~~~~~~~~~~~~~~~~~~~~~
363352
364353
Then, enable the bundle by adding it to the list of registered bundles
365-
in the ``app/AppKernel.php`` file of your project::
366-
367-
// app/AppKernel.php
368-
369-
// ...
370-
class AppKernel extends Kernel
371-
{
372-
public function registerBundles()
373-
{
374-
$bundles = [
375-
// ...
376-
377-
new <vendor>\<bundle-name>\<bundle-long-name>(),
378-
];
379-
380-
// ...
381-
}
354+
in the ``config/bundles.php`` file of your project::
382355
356+
// config/bundles.php
357+
return [
383358
// ...
384-
}
359+
<vendor>\<bundle-name>\<bundle-long-name>::class => ['all' => true],
360+
];
385361
386362
.. _`installation chapter`: https://getcomposer.org/doc/00-intro.md
387363

bundles/configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ Providing an XML Schema
381381

382382
XML has a very useful feature called `XML schema`_. This allows you to
383383
describe all possible elements and attributes and their values in an XML Schema
384-
Definition (an xsd file). This XSD file is used by IDEs for auto completion and
384+
Definition (an XSD file). This XSD file is used by IDEs for auto completion and
385385
it is used by the Config component to validate the elements.
386386

387387
In order to use the schema, the XML configuration file must provide an

bundles/inheritance.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
How to Use Bundle Inheritance to Override Parts of a Bundle
55
===========================================================
66

7-
.. caution::
7+
.. deprecated:: 3.4
88

99
Bundle inheritance was removed in Symfony 4.0, but you can
1010
:doc:`override any part of a bundle </bundles/override>` without

bundles/override.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,6 @@ For this reason, you can override any bundle translation file from the main
178178

179179
For example, to override the translations defined in the
180180
``Resources/translations/FOSUserBundle.es.yml`` file of the FOSUserBundle,
181-
create a``<your-project>/translations/FOSUserBundle.es.yml`` file.
181+
create a ``<your-project>/translations/FOSUserBundle.es.yml`` file.
182182

183183
.. _`the Doctrine documentation`: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/inheritance-mapping.html#overrides

0 commit comments

Comments
 (0)