Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 42963b9

Browse files
committed
Merge branch '5.2' into 5.x
* 5.2: Fixing syntax error in PHP, XML and Yaml examples
2 parents dc94947 + a91de90 commit 42963b9

23 files changed

+57
-46
lines changed

cache.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ with either :class:`Symfony\\Contracts\\Cache\\CacheInterface` or
374374
375375
$services->set('app.cace.adapter.redis')
376376
->parent('cache.adapter.redis')
377-
->tag('cache.pool', ['namespace' => 'my_custom_namespace'])
377+
->tag('cache.pool', ['namespace' => 'my_custom_namespace']);
378378
};
379379
380380
Custom Provider Options

components/console/helpers/table.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ This results in:
338338
$table->setHeaders([
339339
[new TableCell('Main table title', ['colspan' => 3])],
340340
['ISBN', 'Title', 'Author'],
341-
])
341+
]);
342342
// ...
343343

344344
This generates:

configuration/using_parameters_in_dic.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ Now, examine the results to see this closely:
7777
$container->loadFromExtension('my_bundle', [
7878
'logging' => true,
7979
// true, as expected
80-
)
81-
];
80+
]
81+
);
8282
8383
$container->loadFromExtension('my_bundle', [
8484
'logging' => "%kernel.debug%",

form/inherit_data_option.rst

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,20 @@ Finally, make this work by adding the location form to your two original forms::
129129
namespace App\Form\Type;
130130

131131
use App\Entity\Company;
132+
use Symfony\Component\Form\AbstractType;
133+
132134
// ...
133135

134-
public function buildForm(FormBuilderInterface $builder, array $options): void
136+
class CompanyType extends AbstractType
135137
{
136-
// ...
138+
public function buildForm(FormBuilderInterface $builder, array $options): void
139+
{
140+
// ...
137141

138-
$builder->add('foo', LocationType::class, [
139-
'data_class' => Company::class,
140-
]);
142+
$builder->add('foo', LocationType::class, [
143+
'data_class' => Company::class,
144+
]);
145+
}
141146
}
142147

143148
.. code-block:: php
@@ -146,15 +151,18 @@ Finally, make this work by adding the location form to your two original forms::
146151
namespace App\Form\Type;
147152
148153
use App\Entity\Customer;
149-
// ...
154+
use Symfony\Component\Form\AbstractType;
150155
151-
public function buildForm(FormBuilderInterface $builder, array $options): void
156+
class CustomerType extends AbstractType
152157
{
153-
// ...
158+
public function buildForm(FormBuilderInterface $builder, array $options): void
159+
{
160+
// ...
154161
155-
$builder->add('bar', LocationType::class, [
156-
'data_class' => Customer::class,
157-
]);
162+
$builder->add('bar', LocationType::class, [
163+
'data_class' => Customer::class,
164+
]);
165+
}
158166
}
159167
160168
That's it! You have extracted duplicated field definitions to a separate

http_client.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ each request (which overrides any global authentication):
425425
auth-bearer="the-bearer-token"
426426
auth-ntlm="the-username:the-password"
427427
/>
428-
</framework-http-client>
428+
</framework:http-client>
429429
</framework:config>
430430
</container>
431431

messenger.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1532,7 +1532,7 @@ this globally (or for each transport) to a service that implements
15321532
],
15331533
'transports' => [
15341534
'async_priority_normal' => [
1535-
'dsn' => // ...
1535+
'dsn' => ...,
15361536
'serializer' => 'messenger.transport.symfony_serializer',
15371537
],
15381538
],

messenger/multiple_buses.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ an **event bus**. The event bus could have zero or more subscribers.
5656
<framework:bus name="command.bus">
5757
<framework:middleware id="validation"/>
5858
<framework:middleware id="doctrine_transaction"/>
59-
<framework:bus>
59+
</framework:bus>
6060
<framework:bus name="query.bus">
6161
<framework:middleware id="validation"/>
62-
<framework:bus>
62+
</framework:bus>
6363
<framework:bus name="event.bus" default-middleware="allow_no_handlers">
6464
<framework:middleware id="validation"/>
65-
<framework:bus>
65+
</framework:bus>
6666
</framework:messenger>
6767
</framework:config>
6868
</container>

reference/configuration/doctrine.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ directory instead:
329329
330330
.. code-block:: xml
331331
332-
<?xml version="1.0" charset="UTF-8" ?>
332+
<?xml version="1.0" encoding="UTF-8" ?>
333333
<container xmlns="http://symfony.com/schema/dic/services"
334334
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
335335
xmlns:doctrine="http://symfony.com/schema/dic/doctrine"
@@ -380,7 +380,7 @@ namespace in the ``src/Entity`` directory and gives them an ``App`` alias
380380
381381
.. code-block:: xml
382382
383-
<?xml version="1.0" charset="UTF-8" ?>
383+
<?xml version="1.0" encoding="UTF-8" ?>
384384
<container xmlns="http://symfony.com/schema/dic/services"
385385
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
386386
xmlns:doctrine="http://symfony.com/schema/dic/doctrine"

reference/configuration/framework.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2913,7 +2913,7 @@ To configure a Redis cache pool with a default lifetime of 1 hour, do the follow
29132913
<framework:pool
29142914
name="cache.mycache"
29152915
adapter="cache.adapter.redis"
2916-
default-lifetime=3600
2916+
default-lifetime="3600"
29172917
/>
29182918
</framework:cache>
29192919
<!-- ... -->

reference/configuration/security.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ encoding algorithm. Also, each algorithm defines different config options:
162162
.. code-block:: xml
163163
164164
<!-- config/packages/security.xml -->
165-
<?xml version="1.0" charset="UTF-8" ?>
165+
<?xml version="1.0" encoding="UTF-8" ?>
166166
<srv:container xmlns="http://symfony.com/schema/dic/security"
167167
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
168168
xmlns:srv="http://symfony.com/schema/dic/services"
@@ -764,7 +764,7 @@ multiple firewalls, the "context" could actually be shared:
764764
.. code-block:: xml
765765
766766
<!-- config/packages/security.xml -->
767-
<?xml version="1.0" charset="UTF-8" ?>
767+
<?xml version="1.0" encoding="UTF-8" ?>
768768
<srv:container xmlns="http://symfony.com/schema/dic/security"
769769
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
770770
xmlns:srv="http://symfony.com/schema/dic/services"

reference/constraints/IsFalse.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ method returns **false**:
118118
'message' => "You've entered an invalid state.",
119119
]));
120120
}
121-
}
122121
123-
public function isStateInvalid()
124-
{
125-
// ...
122+
public function isStateInvalid()
123+
{
124+
// ...
125+
}
126126
}
127127
128128
.. include:: /reference/constraints/_null-values-are-valid.rst.inc

security/custom_authentication_provider.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ to service ids that may not exist yet: ``App\Security\Authentication\Provider\Ws
422422
423423
.. code-block:: php
424424
425-
// config/services.php
425+
// config/services.php
426426
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
427427
428428
use App\Security\Authentication\Provider\WsseProvider;

security/form_login_setup.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Edit the ``security.yaml`` file in order to declare the ``/logout`` path:
107107
.. code-block:: xml
108108
109109
<!-- config/packages/security.xml -->
110-
<?xml version="1.0" charset="UTF-8" ?>
110+
<?xml version="1.0" encoding="UTF-8" ?>
111111
<srv:container xmlns="http://symfony.com/schema/dic/security"
112112
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
113113
xmlns:srv="http://symfony.com/schema/dic/services"
@@ -321,7 +321,7 @@ a traditional HTML form that submits to ``/login``:
321321
.. code-block:: xml
322322
323323
<!-- config/packages/security.xml -->
324-
<?xml version="1.0" charset="UTF-8" ?>
324+
<?xml version="1.0" encoding="UTF-8" ?>
325325
<srv:container xmlns="http://symfony.com/schema/dic/security"
326326
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
327327
xmlns:srv="http://symfony.com/schema/dic/services"

security/ldap.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ use the ``ldap`` user provider.
194194
],
195195
],
196196
],
197-
];
197+
]);
198198
199199
.. caution::
200200

@@ -408,7 +408,7 @@ Configuration example for form login
408408
],
409409
],
410410
]
411-
];
411+
]);
412412
413413
Configuration example for HTTP Basic
414414
....................................
@@ -467,7 +467,7 @@ Configuration example for HTTP Basic
467467
'stateless' => true,
468468
],
469469
],
470-
];
470+
]);
471471
472472
Configuration example for form login and query_string
473473
.....................................................

security/named_encoders.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ to apply to all instances of a specific class:
3535
<!-- ... -->
3636
<encoder class="App\Entity\User"
3737
algorithm="auto"
38-
cost=12
38+
cost="12"
3939
/>
4040
</config>
4141
</srv:container>

security/remember_me.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ so ``DoctrineTokenProvider`` can store the tokens:
283283
284284
.. code-block:: xml
285285
286-
# config/packages/doctrine.xml
286+
<!-- config/packages/doctrine.xml -->
287287
<doctrine:dbal schema-filter="~^(?!rememberme_token)~"/>
288288
289289
.. code-block:: php

security/user_provider.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ to retrieve them:
4444
.. code-block:: yaml
4545
4646
# config/packages/security.yaml
47+
security:
4748
# ...
4849
4950
providers:

service_container.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,6 @@ for classes under the same namespace:
989989
<services>
990990
<prototype namespace="App\Domain"
991991
resource="../src/App/Domain/*"/>
992-
</prototype>
993992
994993
<!-- ... -->
995994
</services>

service_container/alias_private.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ The following example shows how to inject an anonymous service into another serv
283283
284284
$services->set(Foo::class)
285285
// In versions earlier to Symfony 5.1 the inline_service() function was called inline()
286-
->args([inline_service(AnonymousBar::class)])
286+
->args([inline_service(AnonymousBar::class)]);
287287
};
288288
289289
.. note::
@@ -334,7 +334,7 @@ Using an anonymous service as a factory looks like this:
334334
$services = $configurator->services();
335335
336336
$services->set(Foo::class)
337-
->factory([inline_service(AnonymousBar::class), 'constructFoo'])
337+
->factory([inline_service(AnonymousBar::class), 'constructFoo']);
338338
};
339339
340340
Deprecating Services

service_container/autowiring.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,7 @@ the injection::
521521
// want to use a named autowiring alias, wire it manually:
522522
// ->arg('$transformer', service(UppercaseTransformer::class))
523523
// ...
524+
;
524525
};
525526
526527
Thanks to the ``App\Util\TransformerInterface`` alias, any argument type-hinted

service_container/tags.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ array element. For example, to retrieve the ``handler_two`` handler::
845845
https://symfony.com/schema/dic/services/services-1.0.xsd">
846846
847847
<services>
848-
<!-- ... --!>
848+
<!-- ... -->
849849
850850
<service id="App\HandlerCollection">
851851
<!-- use getIndex() instead of getDefaultIndexName() -->

templates.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -571,11 +571,14 @@ also provides a method to check for template existence. First, get the loader::
571571

572572
use Twig\Environment;
573573

574-
// this code assumes that your service uses autowiring to inject dependencies
575-
// otherwise, inject the service called 'twig' manually
576-
public function __construct(Environment $twig)
574+
class YourService
577575
{
578-
$loader = $twig->getLoader();
576+
// this code assumes that your service uses autowiring to inject dependencies
577+
// otherwise, inject the service called 'twig' manually
578+
public function __construct(Environment $twig)
579+
{
580+
$loader = $twig->getLoader();
581+
}
579582
}
580583

581584
Then, pass the path of the Twig template to the ``exists()`` method of the loader::

workflow/dumping-workflows.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ Below is the configuration for the pull request state machine with styling added
186186
<framework:bg_color>DeepSkyBlue</framework:bg_color>
187187
</framework:metadata>
188188
</framework:place>
189-
</framework:place>
190189
191190
<framework:transition name="submit">
192191
<framework:from>start</framework:from>

0 commit comments

Comments
 (0)