Skip to content

Commit e353f66

Browse files
committed
Merge branch '4.0' into 4.1
* 4.0: the product category must be nullable Added the versionadded directive remove reference to Assetic [Encore] Fix vue-loader installation Add section about anonymous services in YAML update the serializer cache description render versionadded directive outside the code block remove remaining AppBundle references
2 parents 5e020f8 + 7368651 commit e353f66

File tree

9 files changed

+81
-47
lines changed

9 files changed

+81
-47
lines changed

doctrine/associations.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ the ``Product`` entity (and getter & setter methods):
146146
147147
/**
148148
* @ORM\ManyToOne(targetEntity="App\Entity\Category", inversedBy="products")
149-
* @ORM\JoinColumn(nullable=false)
150149
*/
151150
private $category;
152151
@@ -155,7 +154,7 @@ the ``Product`` entity (and getter & setter methods):
155154
return $this->category;
156155
}
157156
158-
public function setCategory(Category $category): self
157+
public function setCategory(?Category $category): self
159158
{
160159
$this->category = $category;
161160

frontend.rst

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,6 @@ Full API
7777

7878
* `Full API`_: https://github.com/symfony/webpack-encore/blob/master/index.js
7979

80-
Assetic
81-
-------
82-
83-
Assetic is a pure PHP library that helps to process & optimize your assets (similar
84-
to Encore). Even though we recommend using Encore, Assetic still works great. For
85-
a comparison, see :doc:`/frontend/encore/versus-assetic`.
86-
8780
For more about Assetic, see :doc:`/frontend/assetic`.
8881

8982
Other Front-End Articles
@@ -93,6 +86,7 @@ Other Front-End Articles
9386
:hidden:
9487
:glob:
9588

89+
frontend/assetic
9690
frontend/encore/installation
9791
frontend/encore/simple-example
9892
frontend/encore/*

frontend/encore/vuejs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Want to use `Vue.js`_? No problem! First, install Vue and some dependencies:
55

66
.. code-block:: terminal
77
8-
$ yarn add --dev vue vue-loader vue-template-compiler
8+
$ yarn add --dev vue vue-loader@^14 vue-template-compiler
99
1010
Then, activate the ``vue-loader`` in ``webpack.config.js``:
1111

reference/configuration/framework.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1822,6 +1822,8 @@ the ``dev`` environment).
18221822
given the adapter they are based on. Internally, a pool wraps the definition
18231823
of an adapter.
18241824

1825+
.. _reference-cache-systen:
1826+
18251827
system
18261828
......
18271829

serializer.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,10 @@ stored in one of the following locations:
147147
Configuring the Metadata Cache
148148
------------------------------
149149

150-
The metadata for the serializer is automatically cached. To configure the cache,
151-
configure the ``framework.cache.pools`` key in ``config/packages/framework.yaml``.
150+
The metadata for the serializer is automatically cached to enhance application
151+
performance. By default, the serializer uses the ``cache.system`` cache pool
152+
which is configured using the :ref:`cache.system <reference-cache-systen>`
153+
option.
152154

153155
Enabling a Name Converter
154156
-------------------------

service_container/alias_private.rst

Lines changed: 61 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,10 @@ Anonymous Services
151151

152152
.. note::
153153

154-
Anonymous services are only supported by the XML configuration format.
154+
Anonymous services are only supported by the XML and YAML configuration formats.
155+
156+
.. versionadded:: 3.3
157+
The feature to configure anonymous services in YAML was introduced in Symfony 3.3.
155158

156159
In some cases, you may want to prevent a service being used as a dependency of
157160
other services. This can be achieved by creating an anonymous service. These
@@ -160,23 +163,63 @@ created where they are used.
160163

161164
The following example shows how to inject an anonymous service into another service:
162165

163-
.. code-block:: xml
164-
165-
<!-- app/config/services.xml -->
166-
<?xml version="1.0" encoding="UTF-8" ?>
167-
<container xmlns="http://symfony.com/schema/dic/services"
168-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
169-
xsi:schemaLocation="http://symfony.com/schema/dic/services
170-
http://symfony.com/schema/dic/services/services-1.0.xsd">
171-
172-
<services>
173-
<service id="foo" class="App\Foo">
174-
<argument type="service">
175-
<service class="App\AnonymousBar" />
176-
</argument>
177-
</service>
178-
</services>
179-
</container>
166+
.. configuration-block::
167+
168+
.. code-block:: yaml
169+
170+
# app/config/services.yaml
171+
services:
172+
App\Foo:
173+
arguments:
174+
- !service
175+
class: App\AnonymousBar
176+
177+
.. code-block:: xml
178+
179+
<!-- app/config/services.xml -->
180+
<?xml version="1.0" encoding="UTF-8" ?>
181+
<container xmlns="http://symfony.com/schema/dic/services"
182+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
183+
xsi:schemaLocation="http://symfony.com/schema/dic/services
184+
http://symfony.com/schema/dic/services/services-1.0.xsd">
185+
186+
<services>
187+
<service id="foo" class="App\Foo">
188+
<argument type="service">
189+
<service class="App\AnonymousBar" />
190+
</argument>
191+
</service>
192+
</services>
193+
</container>
194+
195+
Using an anonymous service as a factory looks like this:
196+
197+
.. configuration-block::
198+
199+
.. code-block:: yaml
200+
201+
# app/config/services.yaml
202+
services:
203+
App\Foo:
204+
factory: [ !service { class: App\FooFactory }, 'constructFoo' ]
205+
206+
.. code-block:: xml
207+
208+
<!-- app/config/services.xml -->
209+
<?xml version="1.0" encoding="UTF-8" ?>
210+
<container xmlns="http://symfony.com/schema/dic/services"
211+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
212+
xsi:schemaLocation="http://symfony.com/schema/dic/services
213+
http://symfony.com/schema/dic/services/services-1.0.xsd">
214+
215+
<services>
216+
<service id="foo" class="App\Foo">
217+
<factory method="constructFoo">
218+
<service class="App\FooFactory"/>
219+
</factory>
220+
</service>
221+
</services>
222+
</container>
180223
181224
Deprecating Services
182225
--------------------

service_container/service_decoration.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ the original service is lost:
3131
<services>
3232
<service id="App\Mailer" />
3333
34-
<!-- this replaces the old AppBundle\Mailer definition with the new
34+
<!-- this replaces the old App\Mailer definition with the new
3535
one, the old definition is lost -->
3636
<service id="App\Mailer" class="App\DecoratingMailer" />
3737
</services>
@@ -45,7 +45,7 @@ the original service is lost:
4545
4646
$container->register(Mailer::class);
4747
48-
// this replaces the old AppBundle\Mailer definition with the new one, the
48+
// this replaces the old App\Mailer definition with the new one, the
4949
// old definition is lost
5050
$container->register(Mailer::class, DecoratingMailer::class);
5151

service_container/service_subscribers_locators.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ Use its ``getSubscribedServices()`` method to include as many services as needed
7171
in the service subscriber and change the type hint of the container to
7272
a PSR-11 ``ContainerInterface``::
7373

74-
// src/AppBundle/CommandBus.php
75-
namespace AppBundle;
74+
// src/CommandBus.php
75+
namespace App;
7676

77-
use AppBundle\CommandHandler\BarHandler;
78-
use AppBundle\CommandHandler\FooHandler;
77+
use App\CommandHandler\BarHandler;
78+
use App\CommandHandler\FooHandler;
7979
use Psr\Container\ContainerInterface;
8080
use Symfony\Component\DependencyInjection\ServiceSubscriberInterface;
8181

@@ -91,8 +91,8 @@ a PSR-11 ``ContainerInterface``::
9191
public static function getSubscribedServices()
9292
{
9393
return [
94-
'AppBundle\FooCommand' => FooHandler::class,
95-
'AppBundle\BarCommand' => BarHandler::class,
94+
'App\FooCommand' => FooHandler::class,
95+
'App\BarCommand' => BarHandler::class,
9696
];
9797
}
9898

@@ -204,7 +204,7 @@ service type to a service.
204204
205205
// app/config/services.yml
206206
services:
207-
AppBundle\CommandBus:
207+
App\CommandBus:
208208
tags:
209209
- { name: 'container.service_subscriber', key: 'logger', id: 'monolog.logger.event' }
210210
@@ -218,7 +218,7 @@ service type to a service.
218218
219219
<services>
220220
221-
<service id="AppBundle\CommandBus">
221+
<service id="App\CommandBus">
222222
<tag name="container.service_subscriber" key="logger" id="monolog.logger.event" />
223223
</service>
224224
@@ -228,7 +228,7 @@ service type to a service.
228228
.. code-block:: php
229229
230230
// app/config/services.php
231-
use AppBundle\CommandBus;
231+
use App\CommandBus;
232232
233233
// ...
234234

templating/twig_extension.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,6 @@ previous ``priceFilter()`` method::
137137
}
138138
}
139139

140-
Register the Lazy-Loaded Extension as a Service
141-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
142-
143-
.. versionadded:: 3.4
144-
The ``RuntimeExtensionInterface`` was introduced in Symfony 3.4.
145-
146140
If you're using the default ``services.yaml`` configuration, this will already
147141
work! Otherwise, :ref:`create a service <service-container-creating-service>`
148142
for this class and :doc:`tag your service </service_container/tags>` with ``twig.runtime``.

0 commit comments

Comments
 (0)