8000 minor #15250 Fixing syntax error in PHP, XML and Yaml examples (Nyholm) · symfony/symfony-docs@8c38a35 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8c38a35

Browse files
committed
minor #15250 Fixing syntax error in PHP, XML and Yaml examples (Nyholm)
This PR was squashed before being merged into the 4.4 branch. Discussion ---------- Fixing syntax error in PHP, XML and Yaml examples I used my new and shiny feature to the docs-parser =) https://github.com/weaverryan/docs-builder/pull/97 Commits ------- baf9154 Fixing syntax error in PHP, XML and Yaml examples
2 parents 3329614 + baf9154 commit 8c38a35

23 files changed

+56
-45
lines changed

cache.rst

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

components/console/helpers/table.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ This results in:
305305
$table->setHeaders([
306306
[new TableCell('Main table title', ['colspan' => 3])],
307307
['ISBN', 'Title', 'Author'],
308-
])
308+
]);
309309
// ...
310310

311311
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
@@ -428,7 +428,7 @@ each request (which overrides any global authentication):
428428
auth-bearer="the-bearer-token"
429429
auth-ntlm="the-username:the-password"
430430
/>
431-
</framework-http-client>
431+
</framework:http-client>
432432
</framework:config>
433433
</container>
434434

messenger.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ this globally (or for each transport) to a service that implements
12191219
],
12201220
'transports' => [
12211221
'async_priority_normal' => [
1222-
'dsn' => // ...
1222+
'dsn' => ...,
12231223
'serializer' => 'messenger.transport.symfony_serializer',
12241224
],
12251225
],

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
@@ -327,7 +327,7 @@ directory instead:
327327
328328
.. code-block:: xml
329329
330-
<?xml version="1.0" charset="UTF-8" ?>
330+
<?xml version="1.0" encoding="UTF-8" ?>
331331
<container xmlns="http://symfony.com/schema/dic/services"
332332
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
333333
xmlns:doctrine="http://symfony.com/schema/dic/doctrine"
@@ -378,7 +378,7 @@ namespace in the ``src/Entity`` directory and gives them an ``App`` alias
378378
379379
.. code-block:: xml
380380
381-
<?xml version="1.0" charset="UTF-8" ?>
381+
<?xml version="1.0" encoding="UTF-8" ?>
382382
<container xmlns="http://symfony.com/schema/dic/services"
383383
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
384384
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
@@ -2751,7 +2751,7 @@ To configure a Redis cache pool with a default lifetime of 1 hour, do the follow
27512751
<framework:< 10795 span class="pl-ent">pool
27522752
name="cache.mycache"
27532753
adapter="cache.adapter.redis"
2754-
default-lifetime=3600
2754+
default-lifetime="3600"
27552755
/>
27562756
</framework:cache>
27572757
<!-- ... -->

reference/configuration/security.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ encoding algorithm. Also, each algorithm defines different config options:
167167
.. code-block:: xml
168168
169169
<!-- config/packages/security.xml -->
170-
<?xml version="1.0" charset="UTF-8" ?>
170+
<?xml version="1.0" encoding="UTF-8" ?>
171171
<srv:container xmlns="http://symfony.com/schema/dic/security"
172172
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
173173
xmlns:srv="http://symfony.com/schema/dic/services"
@@ -716,7 +716,7 @@ multiple firewalls, the "context" could actually be shared:
716716
.. code-block:: xml
717717
718718
<!-- config/packages/security.xml -->
719-
<?xml version="1.0" charset="UTF-8" ?>
719+
<?xml version="1.0" encoding="UTF-8" ?>
720720
<srv:container xmlns="http://symfony.com/schema/dic/security"
721721
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
722722
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
@@ -100,11 +100,11 @@ method returns **false**:
100100
'message' => "You've entered an invalid state.",
101101
]));
102102
}
103-
}
104103
105-
public function isStateInvalid()
106< F438 /code>-
{
107-
// ...
104+
public function isStateInvalid()
105+
{
106+
// ...
107+
}
108108
}
109109
110110
.. 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"
@@ -319,7 +319,7 @@ a traditional HTML form that submits to ``/login``:
319319
.. code-block:: xml
320320
321321
<!-- config/packages/security.xml -->
322-
<?xml version="1.0" charset="UTF-8" ?>
322+
<?xml version="1.0" encoding="UTF-8" ?>
323323
<srv:container xmlns="http://symfony.com/schema/dic/security"
324324
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
325325
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
@@ -198,7 +198,7 @@ use the ``ldap`` user provider.
198198
],
199199
],
200200
],
201-
];
201+
]);
202202
203203
.. caution::
204204

@@ -414,7 +414,7 @@ Configuration example for form login
414414
],
415415
],
416416
]
417-
];
417+
]);
418418
419419
Configuration example for HTTP Basic
420420
....................................
@@ -471,7 +471,7 @@ Configuration example for HTTP Basic
471471
'stateless' => true,
472472
],
473473
],
474-
];
474+
]);
475475
476476
Configuration example for form login and query_string
477477
.....................................................

security/named_encoders.rst

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

security/remember_me.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ so ``DoctrineTokenProvider`` can store the tokens:
263263
264264
.. code-block:: xml
265265
266-
# config/packages/doctrine.xml
266+
<!-- config/packages/doctrine.xml -->
267267
<doctrine:dbal schema-filter="~^(?!rememberme_token)~"/>
268268
269269
.. 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
@@ -1033,7 +1033,6 @@ for classes under the same namespace:
10331033
<services>
10341034
<prototype namespace="App\Domain"
10351035
resource="../src/App/Domain/*"/>
1036-
</prototype>
10371036
10381037
<!-- ... -->
10391038
</services>

service_container/alias_private.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ The following example shows how to inject an anonymous service into another serv
269269
$services = $configurator->services();
270270
271271
$services->set(Foo::class)
272-
->args([inline(AnonymousBar::class)])
272+
->args([inline(AnonymousBar::class)]);
273273
};
274274
275275
.. note::
@@ -320,7 +320,7 @@ Using an anonymous service as a factory looks like this:
320320
$services = $configurator->services();
321321
322322
$services->set(Foo::class)
323-
->factory([inline(AnonymousBar::class), 'constructFoo'])
323+
->factory([inline(AnonymousBar::class), 'constructFoo']);
324324
};
325325
326326
Deprecating Services

service_container/autowiring.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@ the injection::
526526
// want to use a named autowiring alias, wire it manually:
527527
// ->arg('$transformer', ref(UppercaseTransformer::class))
528528
// ...
529+
;
529530
};
530531
531532
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
@@ -847,7 +847,7 @@ array element. For example, to retrieve the ``handler_two`` handler::
847847
https://symfony.com/schema/dic/services/services-1.0.xsd">
848848
849849
<services>
850-
<!-- ... --!>
850+
<!-- ... -->
851851
852852
<service id="App\HandlerCollection">
853853
<!-- use getIndex() instead of getDefaultIndexName() -->

templates.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,9 +553,12 @@ also provides a method to check for template existence. First, get the loader::
553553
// in a service using autowiring
554554
use Twig\Environment;
555555

556-
public function __construct(Environment $twig)
556+
class YourService
557557
{
558-
$loader = $twig->getLoader();
558+
public function __construct(Environment $twig)
559+
{
560+
$loader = $twig->getLoader();
561+
}
559562
}
560563

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

workflow/dumping-workflows.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ You can use ``metadata`` with the following keys to style the workflow:
6363

6464
* ``bg_color``: a color;
6565
* ``description``: a string that describes the state.
66-
66+
6767
* for transitions:
6868

6969
* ``label``: a string that replaces the name of the transition;
@@ -169,7 +169,6 @@ Below is the configuration for the pull request state machine with styling added
169169
<framework:bg_color>DeepSkyBlue</framework:bg_color>
170170
</framework:metadata>
171171
</framework:place>
172-
</framework:place>
173172
174173
<framework:transition name="submit">
175174
<framework:from>start</framework:from>

0 commit comments

Comments
 (0)
0