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

Skip to content

Commit 3d61281

Browse files
atailouloutexabbuh
authored andcommitted
lots of minor tweaks and fixes
1 parent c52bcd6 commit 3d61281

32 files changed

+58
-45
lines changed

assetic/asset_management.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ configuration under the ``assetic`` section. Read more in the
328328
),
329329
),
330330
),
331-
);
331+
));
332332
333333
After you have defined the named assets, you can reference them in your templates
334334
with the ``@named_asset`` notation:

assetic/jpeg_optimize.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ following configuration:
232232
),
233233
'twig' => array(
234234
'functions' => array('jpegoptim'),
235-
),
236235
),
237236
));
238237
@@ -294,7 +293,7 @@ file:
294293
'twig' => array(
295294
'functions' => array(
296295
'jpegoptim' => array(
297-
output => 'images/*.jpg'
296+
'output' => 'images/*.jpg'
298297
),
299298
),
300299
),

assetic/uglifyjs.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@ can configure its location using the ``node`` key:
168168
169169
// app/config/config.php
170170
$container->loadFromExtension('assetic', array(
171-
'node' => '/usr/bin/nodejs',
171+
'node' => '/usr/bin/nodejs',
172172
'uglifyjs2' => array(
173-
// the path to the uglifyjs executable
174-
'bin' => '/usr/local/bin/uglifyjs',
175-
),
173+
// the path to the uglifyjs executable
174+
'bin' => '/usr/local/bin/uglifyjs',
175+
),
176176
));
177177
178178
Minify your Assets

components/routing.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ to find a route that fits the given request you can also build a URL from
206206
a certain route::
207207

208208
use Symfony\Component\Routing\Generator\UrlGenerator;
209+
use Symfony\Component\Routing\RequestContext;
210+
use Symfony\Component\Routing\Route;
211+
use Symfony\Component\Routing\RouteCollection;
209212

210213
$routes = new RouteCollection();
211214
$routes->add('show_post', new Route('/show/{slug}'));
@@ -321,7 +324,7 @@ a path to the main route definition and some other settings::
321324
$resource,
322325
array $options = array(),
323326
RequestContext $context = null,
324-
array $defaults = array()
327+
LoggerInterface $logger = null
325328
);
326329

327330
With the ``cache_dir`` option you can enable route caching (if you provide a

components/security/authentication.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ The default authentication manager is an instance of
7676
:class:`Symfony\\Component\\Security\\Core\\Authentication\\AuthenticationProviderManager`::
7777

7878
use Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager;
79+
use Symfony\Component\Security\Core\Exception\AuthenticationException;
7980

8081
// instances of Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface
8182
$providers = array(...);
@@ -234,6 +235,7 @@ own, it just needs to follow these rules:
234235
}
235236

236237
// ...
238+
}
237239
}
238240

239241
Using Password Encoders

configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ configure DoctrineBundle and other parts of Symfony:
316316
.. code-block:: php
317317
318318
// app/config/config.php
319-
$configuration->loadFromExtension('doctrine', array(
319+
$container->loadFromExtension('doctrine', array(
320320
'dbal' => array(
321321
'driver' => 'pdo_mysql',
322322
// ...

configuration/environments.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ The best way to accomplish this is via a new environment called, for example,
294294
.. code-block:: php
295295
296296
// app/config/config_benchmark.php
297-
$loader->import('config_prod.php')
297+
$loader->import('config_prod.php');
298298
299299
$container->loadFromExtension('framework', array(
300300
'profiler' => array('only_exceptions' => false),

controller/service.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ controller:
335335
$templating = $this->templating;
336336
$callback = function () use ($templating, $view, $parameters) {
337337
$templating->stream($view, $parameters);
338-
}
338+
};
339339
340340
return new StreamedResponse($callback);
341341

doctrine.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ information. By convention, this information is usually configured in an
9595
.. code-block:: php
9696
9797
// app/config/config.php
98-
$configuration->loadFromExtension('doctrine', array(
98+
$container->loadFromExtension('doctrine', array(
9999
'dbal' => array(
100100
'driver' => 'pdo_mysql',
101101
'host' => '%database_host%',

form/action_method.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ to the ``form()`` or the ``form_start()`` helper functions:
4747

4848
.. code-block:: html+php
4949

50-
<!-- app/Resources/views/default/newAction.html.php -->
50+
<!-- app/Resources/views/default/new.html.php -->
5151
<?php echo $view['form']->start($form, array(
5252
'action' => $view['router']->generate('target_route'),
5353
'method' => 'GET',

form/create_form_type_extension.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ tag:
120120
121121
$container
122122
->register('app.image_type_extension', ImageTypeExtension::class)
123-
->addTag('form.type_extension', array('alias' => 'file'));
123+
->addTag('form.type_extension', array('alias' => 'file'))
124124
;
125125
126126
The ``alias`` key of the tag is the type of field that this extension should

form/data_transformers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Suppose you have a Task form with a tags ``text`` type::
3535
{
3636
public function buildForm(FormBuilderInterface $builder, array $options)
3737
{
38-
$builder->add('tags', 'text')
38+
$builder->add('tags', 'text');
3939
}
4040

4141
public function configureOptions(OptionsResolver $resolver)

form/without_class.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,4 @@ but here's a short example:
104104

105105
.. code-block:: php
106106
107-
new NotBlank(array('groups' => array('create', 'update')))
107+
new NotBlank(array('groups' => array('create', 'update')));

http_cache/cache_invalidation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ Here is how you can configure the Symfony reverse proxy to support the
7474

7575
$response = new Response();
7676
if ($this->getStore()->purge($request->getUri())) {
77-
$response->setStatusCode(200, 'Purged');
77+
$response->setStatusCode(Response::HTTP_OK, 'Purged');
7878
} else {
79-
$response->setStatusCode(404, 'Not found');
79+
$response->setStatusCode(Response::HTTP_NOT_FOUND, 'Not found');
8080
}
8181

8282
return $response;

http_cache/esi.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,10 @@ matter), Symfony uses the standard ``render`` helper to configure ESI tags:
137137
.. code-block:: html+php
138138

139139
<!-- app/Resources/views/static/about.html.php -->
140-
140+
<?php
141141
// you can use a controller reference
142142
use Symfony\Component\HttpKernel\Controller\ControllerReference;
143+
?>
143144
<?php echo $view['actions']->render(
144145
new ControllerReference(
145146
'AppBundle:News:latest',
@@ -148,15 +149,17 @@ matter), Symfony uses the standard ``render`` helper to configure ESI tags:
148149
array('strategy' => 'esi')
149150
) ?>
150151

152+
<?php
151153
// ... or a URL
152154
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
155+
?>
153156
<?php echo $view['actions']->render(
154157
$view['router']->generate(
155158
'latest_news',
156159
array('maxPerPage' => 5),
157160
UrlGeneratorInterface::ABSOLUTE_URL
158161
),
159-
array('strategy' => 'esi'),
162+
array('strategy' => 'esi')
160163
) ?>
161164

162165
By using the ``esi`` renderer (via the ``render_esi()`` Twig function), you
@@ -234,7 +237,7 @@ that must be enabled in your configuration:
234237
<?xml version="1.0" encoding="UTF-8" ?>
235238
<container xmlns="http://symfony.com/schema/dic/services"
236239
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
237-
xmlns:doctrine="http://symfony.com/schema/dic/framework"
240+
xmlns:framework="http://symfony.com/schema/dic/framework"
238241
xsi:schemaLocation="http://symfony.com/schema/dic/services
239242
http://symfony.com/schema/dic/services/services-1.0.xsd
240243
http://symfony.com/schema/dic/symfony

http_cache/expiration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Most of the time, you will use the ``Cache-Control`` header. Recall that the
3636
``Cache-Control`` header is used to specify many different cache directives::
3737

3838
// Sets the number of seconds after which the response
39-
// should no longer be considered fresh
39+
// should no longer be considered fresh by shared caches
4040
$response->setSharedMaxAge(600);
4141

4242
The ``Cache-Control`` header would take on the following format (it may have

reference/constraints/CardScheme.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ on an object that will contain a credit card number.
2828
.. code-block:: php-annotations
2929
3030
// src/AppBundle/Entity/Transaction.php
31-
namespace AppBundle\Entity\Transaction;
31+
namespace AppBundle\Entity;
3232
3333
use Symfony\Component\Validator\Constraints as Assert;
3434
@@ -76,7 +76,7 @@ on an object that will contain a credit card number.
7676
.. code-block:: php
7777
7878
// src/AppBundle/Entity/Transaction.php
79-
namespace AppBundle\Entity\Transaction;
79+
namespace AppBundle\Entity;
8080
8181
use Symfony\Component\Validator\Mapping\ClassMetadata;
8282
use Symfony\Component\Validator\Constraints as Assert;

reference/constraints/UniqueEntity.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ your user table:
8989
9090
.. code-block:: php
9191
92-
// src/AppBundle/Entity/User.php
92+
// src/AppBundle/Entity/Author.php
9393
namespace AppBundle\Entity;
9494
9595
use Symfony\Component\Validator\Constraints as Assert;

reference/dic_tags.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,7 @@ If you do need to use this tag, just make a new class that implements the
14391439
:class:`Symfony\\Component\\Validator\\ObjectInitializerInterface` interface.
14401440
Then, tag it with the ``validator.initializer`` tag (it has no options).
14411441

1442-
For an example, see the ``EntityInitializer`` class inside the Doctrine
1442+
For an example, see the ``DoctrineInitializer`` class inside the Doctrine
14431443
Bridge.
14441444

14451445
.. _`Twig's documentation`: http://twig.sensiolabs.org/doc/advanced.html#creating-an-extension

routing/hostname_pattern.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ instance, if you want to match both ``m.example.com`` and
193193
<?xml version="1.0" encoding="UTF-8" ?>
194194
<routes xmlns="http://symfony.com/schema/routing"
195195
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
196-
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
196+
xsi:schemaLocation="http://symfony.com/schema/routing
197+
http://symfony.com/schema/routing/routing-1.0.xsd">
197198
198199
<route id="mobile_homepage" path="/" host="m.{domain}">
199200
<default key="_controller">AcmeDemoBundle:Main:mobileHomepage</default>
@@ -251,7 +252,8 @@ You can also set the host option on imported routes:
251252
<?xml version="1.0" encoding="UTF-8" ?>
252253
<routes xmlns="http://symfony.com/schema/routing"
253254
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
254-
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
255+
xsi:schemaLocation="http://symfony.com/schema/routing
256+
http://symfony.com/schema/routing/routing-1.0.xsd">
255257
256258
<import resource="@AcmeHelloBundle/Resources/config/routing.xml" host="hello.example.com" />
257259
</routes>

routing/requirements.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ accomplished with the following route configuration:
184184

185185
.. code-block:: php-annotations
186186
187-
// src/AppBundle/Controller/MainController.php
187+
// src/AppBundle/Controller/BlogApiController.php
188188
namespace AppBundle\Controller;
189189
190190
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;

security.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ configuration looks like this:
8686
),
8787
'firewalls' => array(
8888
'dev' => array(
89-
'pattern' => '^/(_(profiler|wdt)|css|images|js)/',
90-
'security' => false,
89+
'pattern' => '^/(_(profiler|wdt)|css|images|js)/',
90+
'security' => false,
9191
),
9292
'default' => array(
93-
'anonymous' => null,
93+
'anonymous' => null,
9494
),
9595
),
9696
));
@@ -257,7 +257,7 @@ user to be logged in to access this URL:
257257
),
258258
'access_control' => array(
259259
// require ROLE_ADMIN for /admin*
260-
array('path' => '^/admin', 'role' => 'ROLE_ADMIN'),
260+
array('path' => '^/admin', 'roles' => 'ROLE_ADMIN'),
261261
),
262262
));
263263

security/acl.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,12 @@ First, you need to configure the connection the ACL system is supposed to use:
7777
.. code-block:: php
7878
7979
// app/config/security.php
80-
$container->loadFromExtension('security', 'acl', array(
80+
$container->loadFromExtension('security', array(
8181
// ...
82-
83-
'connection' => 'default',
82+
83+
'acl' => array(
84+
'connection' => 'default',
85+
),
8486
));
8587
8688
.. note::

security/impersonating_user.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ to show a link to exit impersonation:
9797
<a
9898
href="<?php echo $view['router']->generate('homepage', array(
9999
'_switch_user' => '_exit',
100-
) ?>"
100+
)) ?>"
101101
>
102102
Exit impersonation
103103
</a>

security/pre_authenticated.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ corresponding firewall in your security configuration:
142142
$container->loadFromExtension('security', array(
143143
'firewalls' => array(
144144
'secured_area' => array(
145-
'pattern' => '^/'
145+
'pattern' => '^/',
146146
'remote_user' => array(
147147
'provider' => 'your_user_provider',
148148
),

security/voters.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ security configuration:
279279
>
280280
281281
<config>
282-
<access-decision-manager strategy="unanimous">
282+
<access-decision-manager strategy="unanimous" />
283283
</config>
284284
</srv:container>
285285

service_container.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ Injecting the dependency by the setter method just needs a change of syntax:
444444
445445
$container->setDefinition('app.mailer', ...);
446446
447-
$definition = new Definition(NewsletterManager::class)
447+
$definition = new Definition(NewsletterManager::class);
448448
$definition->addMethodCall('setMailer', array(
449449
new Reference('app.mailer'),
450450
));

session/php_bridge.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ for the ``handler_id``:
4242
'session' => array(
4343
'storage_id' => 'session.storage.php_bridge',
4444
'handler_id' => null,
45+
),
4546
));
4647
4748
Otherwise, if the problem is simply that you cannot avoid the application
@@ -77,6 +78,7 @@ the example below:
7778
'session' => array(
7879
'storage_id' => 'session.storage.php_bridge',
7980
'handler_id' => 'session.storage.native_file',
81+
),
8082
));
8183
8284
.. note::

templating/namespaced_paths.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ directory:
6868
$container->loadFromExtension('twig', array(
6969
'paths' => array(
7070
'%kernel.root_dir%/../vendor/acme/foo-bar/templates' => 'foo_bar',
71-
);
71+
)
7272
));
7373
7474
.. caution::

testing/database.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ configuration:
145145
.. code-block:: php
146146
147147
// app/config/config_test.php
148-
$configuration->loadFromExtension('doctrine', array(
148+
$container->loadFromExtension('doctrine', array(
149149
'dbal' => array(
150150
'host' => 'localhost',
151151
'dbname' => 'testdb',

validation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ message:
155155

156156
.. code-block:: text
157157
158-
AppBundle\Author.name:
158+
AppBundle\Entity\Author.name:
159159
This value should not be blank
160160
161161
If you insert a value into the ``name`` property, the happy success message

0 commit comments

Comments
 (0)