Skip to content

Commit 7c2ff24

Browse files
committed
Merge branch '4.0'
* 4.0: doc(http_foundation.rst): Fix code error which used create() instead of constructor method. [#8806] minor reword Minor changes Update article block from pull request feedback. Forgot a apostrophe. Improvements on the apache section. Added the Flex node for Apache. add back the trailing comma remove "choices_as_values" mention Fixed configuration block rendering in routing docs Update entity.rst Removing more AppBundle Follow the same code style in docblock annotations
2 parents bb82909 + 48c1dca commit 7c2ff24

26 files changed

+102
-54
lines changed

best_practices/business-logic.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ looking for mapping information:
206206
* mappedBy="post",
207207
* orphanRemoval=true
208208
* )
209-
* @ORM\OrderBy({"publishedAt" = "ASC"})
209+
* @ORM\OrderBy({"publishedAt"="ASC"})
210210
*/
211211
private $comments;
212212

best_practices/controllers.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ the entity manually. In our application, we have this situation in
192192
.. code-block:: php
193193
194194
/**
195-
* @Route("/comment/{postSlug}/new", name = "comment_new")
195+
* @Route("/comment/{postSlug}/new", name="comment_new")
196196
*/
197197
public function new(Request $request, $postSlug)
198198
{
@@ -218,8 +218,8 @@ flexible:
218218
use Symfony\Component\Routing\Annotation\Route;
219219
220220
/**
221-
* @Route("/comment/{postSlug}/new", name = "comment_new")
222-
* @ParamConverter("post", options={"mapping": {"postSlug": "slug"}})
221+
* @Route("/comment/{postSlug}/new", name="comment_new")
222+
* @ParamConverter("post", options={"mapping"={"postSlug"="slug"}})
223223
*/
224224
public function new(Request $request, Post $post)
225225
{

bundles/best_practices.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,15 +454,15 @@ Resources
454454

455455
If the bundle references any resources (config files, translation files, etc.),
456456
don't use physical paths (e.g. ``__DIR__/config/services.xml``) but logical
457-
paths (e.g. ``@AppBundle/Resources/config/services.xml``).
457+
paths (e.g. ``@FooBundle/Resources/config/services.xml``).
458458

459459
The logical paths are required because of the bundle overriding mechanism that
460460
lets you override any resource/file of any bundle. See :ref:`http-kernel-resource-locator`
461461
for more details about transforming physical paths into logical paths.
462462

463463
Beware that templates use a simplified version of the logical path shown above.
464464
For example, an ``index.html.twig`` template located in the ``Resources/views/Default/``
465-
directory of the AppBundle, is referenced as ``@App/Default/index.html.twig``.
465+
directory of the FooBundle, is referenced as ``@Foo/Default/index.html.twig``.
466466

467467
Learn more
468468
----------

bundles/override.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ features of a bundle.
1212

1313
The bundle overriding mechanism means that you cannot use physical paths to
1414
refer to bundle's resources (e.g. ``__DIR__/config/services.xml``). Always
15-
use logical paths in your bundles (e.g. ``@AppBundle/Resources/config/services.xml``)
15+
use logical paths in your bundles (e.g. ``@FooBundle/Resources/config/services.xml``)
1616
and call the :ref:`locateResource() method <http-kernel-resource-locator>`
1717
to turn them into physical paths when needed.
1818

components/console/helpers/questionhelper.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ method::
247247
// ...
248248
$helper = $this->getHelper('question');
249249

250-
$question = new Question('Please enter the name of the bundle', 'AppBundle');
250+
$question = new Question('Please enter the name of the bundle', 'AcmeDemoBundle');
251251
$question->setNormalizer(function ($value) {
252252
// $value can be null here
253253
return $value ? trim($value) : '';

components/http_foundation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ PHP callable that is able to create an instance of your ``Request`` class::
297297
array $server = array(),
298298
$content = null
299299
) {
300-
return SpecialRequest::create(
300+
return new SpecialRequest(
301301
$query,
302302
$request,
303303
$attributes,

components/http_kernel.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ on the request's information.
258258

259259
a) If the ``_controller`` key doesn't follow the recommended PHP namespace
260260
format (e.g. ``App\Controller\DefaultController::index``) its format is
261-
transformed into it. For example, the legacy ``AppBundle:Default:index``
262-
format would be changed to ``Acme\AppBundle\Controller\DefaultController::indexAction``.
261+
transformed into it. For example, the legacy ``FooBundle:Default:index``
262+
format would be changed to ``Acme\FooBundle\Controller\DefaultController::indexAction``.
263263
This transformation is specific to the :class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver`
264264
sub-class used by the Symfony Framework.
265265

@@ -742,10 +742,10 @@ translation files, etc.)
742742

743743
This overriding mechanism works because resources are referenced not by their
744744
physical path but by their logical path. For example, the ``services.xml`` file
745-
stored in the ``Resources/config/`` directory of a bundle called AppBundle is
746-
referenced as ``@AppBundle/Resources/config/services.xml``. This logical path
745+
stored in the ``Resources/config/`` directory of a bundle called FooBundle is
746+
referenced as ``@FooBundle/Resources/config/services.xml``. This logical path
747747
will work when the application overrides that file and even if you change the
748-
directory of AppBundle.
748+
directory of FooBundle.
749749

750750
The HttpKernel component provides a method called :method:`Symfony\\Component\\HttpKernel\\Kernel::locateResource`
751751
which can be used to transform logical paths into physical paths::
@@ -754,7 +754,7 @@ which can be used to transform logical paths into physical paths::
754754

755755
// ...
756756
$kernel = new HttpKernel($dispatcher, $resolver);
757-
$path = $kernel->locateResource('@AppBundle/Resources/config/services.xml');
757+
$path = $kernel->locateResource('@FooBundle/Resources/config/services.xml');
758758

759759
Learn more
760760
----------

contributing/documentation/standards.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ Code Examples
5454
* The code examples should look real for a web application context. Avoid abstract
5555
or trivial examples (``foo``, ``bar``, ``demo``, etc.);
5656
* The code should follow the :doc:`Symfony Best Practices </best_practices/introduction>`.
57-
Unless the example requires a custom bundle, make sure to always use the
58-
``AppBundle`` bundle to store your code;
5957
* Use ``Acme`` when the code requires a vendor name;
6058
* Use ``example.com`` as the domain of sample URLs and ``example.org`` and
6159
``example.net`` when additional domains are required. All of these domains are

doctrine/multiple_entity_managers.rst

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,21 @@ The following configuration code shows how you can configure two entity managers
5050
default:
5151
connection: default
5252
mappings:
53-
AppBundle: ~
54-
AcmeStoreBundle: ~
53+
Main:
54+
is_bundle: false
55+
type: annotation
56+
dir: '%kernel.project_dir%/src/Entity/Main'
57+
prefix: 'App\Entity\Main'
58+
alias: Main
5559
customer:
5660
connection: customer
5761
mappings:
58-
AcmeCustomerBundle: ~
62+
Customer:
63+
is_bundle: false
64+
type: annotation
65+
dir: '%kernel.project_dir%/src/Entity/Customer'
66+
prefix: 'App\Entity\Customer'
67+
alias: Customer
5968
6069
.. code-block:: xml
6170
@@ -94,12 +103,25 @@ The following configuration code shows how you can configure two entity managers
94103
95104
<doctrine:orm default-entity-manager="default">
96105
<doctrine:entity-manager name="default" connection="default">
97-
<doctrine:mapping name="AppBundle" />
98-
<doctrine:mapping name="AcmeStoreBundle" />
106+
<doctrine:mapping
107+
name="Main"
108+
is_bundle="false"
109+
type="annotation"
110+
dir="%kernel.project_dir%/src/Entity/Main"
111+
prefix="App\Entity\Main"
112+
alias="Main"
113+
/>
99114
</doctrine:entity-manager>
100115
101116
<doctrine:entity-manager name="customer" connection="customer">
102-
<doctrine:mapping name="AcmeCustomerBundle" />
117+
<doctrine:mapping
118+
name="Customer"
119+
is_bundle="false"
120+
type="annotation"
121+
dir="%kernel.project_dir%/src/Entity/Customer"
122+
prefix="App\Entity\Customer"
123+
alias="Customer"
124+
/>
103125
</doctrine:entity-manager>
104126
</doctrine:orm>
105127
</doctrine:config>
@@ -139,14 +161,25 @@ The following configuration code shows how you can configure two entity managers
139161
'default' => array(
140162
'connection' => 'default',
141163
'mappings' => array(
142-
'AppBundle' => null,
143-
'AcmeStoreBundle' => null,
164+
'Main' => array(
165+
is_bundle => false,
166+
type => 'annotation',
167+
dir => '%kernel.project_dir%/src/Entity/Main',
168+
prefix => 'App\Entity\Main',
169+
alias => 'Main',
170+
)
144171
),
145172
),
146173
'customer' => array(
147174
'connection' => 'customer',
148175
'mappings' => array(
149-
'AcmeCustomerBundle' => null,
176+
'Customer' => array(
177+
is_bundle => false,
178+
type => 'annotation',
179+
dir => '%kernel.project_dir%/src/Entity/Customer',
180+
prefix => 'App\Entity\Customer',
181+
alias => 'Customer',
182+
)
150183
),
151184
),
152185
),
@@ -155,8 +188,8 @@ The following configuration code shows how you can configure two entity managers
155188
156189
In this case, you've defined two entity managers and called them ``default``
157190
and ``customer``. The ``default`` entity manager manages entities in the
158-
AppBundle and AcmeStoreBundle, while the ``customer`` entity manager manages
159-
entities in the AcmeCustomerBundle. You've also defined two connections, one
191+
``src/Entity/Main`` directory, while the ``customer`` entity manager manages
192+
entities in ``src/Entity/Customer``. You've also defined two connections, one
160193
for each entity manager.
161194

162195
.. note::

form/create_custom_field_type.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ for form fields, which is ``<BundleName>\Form\Type``. Make sure the field extend
3636
'Expedited Shipping' => 'expedited',
3737
'Priority Shipping' => 'priority',
3838
),
39-
'choices_as_values' => true,
4039
));
4140
}
4241

0 commit comments

Comments
 (0)