8000 Merge branch '4.1' · symfony/symfony-docs@1468994 · GitHub
[go: up one dir, main page]

Skip to content
< 8000 /div>

Commit 1468994

Browse files
committed
Merge branch '4.1'
* 4.1: Updated the doc link Update PHPUnit documentation link Move range to the comparison constraint types Update link to use latest docs Removed an unnecessary comment Added a tip about versioning when using Flex Use SCSS instead of CSS for code block Fix minor typo in the_big_picture.rst Removing calls to deprecated code [HttpFoundation] Small fixes on some examples Fixed Modifying Rendered Tables example Broken nginx XSendfile link
2 parents 4eefc0b + bb1b55a commit 1468994

File tree

11 files changed

+29
-34
lines changed

11 files changed

+29
-34
lines changed

components/asset.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ they all have different base paths::
355355
'doc' => new PathPackage('/somewhere/deep/for/documents', $versionStrategy),
356356
);
357357

358-
$packages = new Packages($defaultPackage, $namedPackages)
358+
$packages = new Packages($defaultPackage, $namedPackages);
359359

360360
The ``Packages`` class allows to define a default package, which will be applied
361361
to assets that don't define the name of package to use. In addition, this

components/console/helpers/table.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -353,18 +353,18 @@ The only requirement to append rows is that the table must be rendered inside a
353353
$section = $output->section();
354354
$table = new Table($section);
355355

356-
$table->addRow(['Row 1']);
356+
$table->addRow(['Love']);
357357
$table->render();
358358

359-
$table->addRow(['Row 2']);
359+
$table->appendRow(['Symfony']);
360360
}
361361
}
362362

363363
This will display the following table in the terminal:
364364

365365
.. code-block:: terminal
366366
367-
+-------+
368-
| Row 1 |
369-
| Row 2 |
370-
+-------+
367+
+---------+
368+
| Love |
369+
| Symfony |
370+
+---------+

components/http_foundation.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -262,23 +262,23 @@ this complexity and defines some methods for the most common tasks::
262262
use Symfony\Component\HttpFoundation\HeaderUtils;
263263

264264
// Splits an HTTP header by one or more separators
265-
HeaderUtils::split('da, en-gb;q=0.8', ',;')
266-
// => array(array('da'), array('en-gb'), array('q', '0.8'))
265+
HeaderUtils::split('da, en-gb;q=0.8', ',;');
266+
// => array(array('da'), array('en-gb','q=0.8'))
267267

268268
// Combines an array of arrays into one associative array
269-
HeaderUtils::combine(array(array('foo', 'abc'), array('bar')))
269+
HeaderUtils::combine(array(array('foo', 'abc'), array('bar')));
270270
// => array('foo' => 'abc', 'bar' => true)
271271

272272
// Joins an associative array into a string for use in an HTTP header
273-
HeaderUtils::toString(array('foo' => 'abc', 'bar' => true, 'baz' => 'a b c'), ',')
273+
HeaderUtils::toString(array('foo' => 'abc', 'bar' => true, 'baz' => 'a b c'), ',');
274274
// => 'foo=abc, bar, baz="a b c"'
275275

276276
// Encodes a string as a quoted string, if necessary
277-
HeaderUtils::quote('foo "bar"')
278-
// => 'foo \"bar\"'
277+
HeaderUtils::quote('foo "bar"');
278+
// => '"foo \"bar\""'
279279

280280
// Decodes a quoted string
281-
HeaderUtils::unquote('foo \"bar\"')
281+
HeaderUtils::unquote('"foo \"bar\""');
282282
// => 'foo "bar"'
283283

284284
Accessing ``Accept-*`` Headers Data
@@ -708,7 +708,7 @@ Learn More
708708
/http_cache/*
709709

710710
.. _Packagist: https://packagist.org/packages/symfony/http-foundation
711-
.. _Nginx: http://wiki.nginx.org/XSendfile
711+
.. _Nginx: https://www.nginx.com/resources/wiki/start/topics/examples/xsendfile/
712712
.. _Apache: https://tn123.org/mod_xsendfile/
713713
.. _`JSON Hijacking`: http://haacked.com/archive/2009/06/25/json-hijacking.aspx
714714
.. _OWASP guidelines: https://www.owasp.org/index.php/OWASP_AJAX_Security_Guidelines#Always_return_JSON_with_an_Object_on_the_outside

doctrine/event_listeners_subscribers.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,21 +95,22 @@ a ``postPersist()`` method, which will be called when the event is dispatched::
9595
// src/EventListener/SearchIndexer.php
9696
namespace App\EventListener;
9797

98-
use Doctrine\ORM\Event\LifecycleEventArgs;
98+
// for Doctrine < 2.4: use Doctrine\ORM\Event\LifecycleEventArgs;
99+
use Doctrine\Common\Persistence\Event\LifecycleEventArgs;
99100
use App\Entity\Product;
100101

101102
class SearchIndexer
102103
{
103104
public function postPersist(LifecycleEventArgs $args)
104105
{
105-
$entity = $args->getEntity();
106+
$entity = $args->getObject();
106107

107108
// only act on some "Product" entity
108109
if (!$entity instanceof Product) {
109110
return;
110111
}
111112

112-
$entityManager = $args->getEntityManager();
113+
$entityManager = $args->getObjectManager();
113114
// ... do something with the Product
114115
}
115116
}
@@ -166,11 +167,11 @@ interface and have an event method for each event it subscribes to::
166167

167168
public function index(LifecycleEventArgs $args)
168169
{
169-
$entity = $args->getEntity();
170+
$entity = $args->getObject();
170171

171172
// perhaps you only want to act on some "Product" entity
172173
if ($entity instanceof Product) {
173-
$entityManager = $args->getEntityManager();
174+
$entityManager = $args->getObjectManager();
174175
// ... do something with the Product
175176
}
176177
}

frontend.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Other Front-End Articles
103103
.. _`Webpack Encore`: https://www.npmjs.com/package/@symfony/webpack-encore
104104
.. _`Webpack`: https://webpack.js.org/
105105
.. _`Webpacker`: https://github.com/rails/webpacker
106-
.. _`Mix`: https://laravel.com/docs/5.4/mix
106+
.. _`Mix`: https://laravel.com/docs/mix
107107
.. _`Symfony`: http://symfony.com/
108108
.. _`Full API`: https://github.com/symfony/webpack-encore/blob/master/index.js
109109
.. _`Webpack Encore screencast series`: https://knpuniversity.com/screencast/webpack-encore

frontend/encore/bootstrap.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Now that ``bootstrap`` lives in your ``node_modules/`` directory, you can
1616
import it from any Sass or JavaScript file. For example, if you already have
1717
a ``global.scss`` file, import it from there:
1818

19-
.. code-block:: css
19+
.. code-block:: scss
2020
2121
// assets/css/global.scss
2222

frontend/encore/versioning.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,10 @@ in your ``script`` and ``link`` tags. If you're using Symfony, just activate the
4444

4545
.. code-block:: yaml
4646
47-
# config/packages/framework.yaml
47+
# this file is added automatically when installing Encore with Symfony Flex
48+
# config/packages/assets.yaml
4849
framework:
49-
# ...
5050
assets:
51-
# feature is supported in Symfony 3.3 and higher
5251
json_manifest_path: '%kernel.project_dir%/public/build/manifest.json'
5352
5453
That's it! Just be sure to wrap each path in the Twig ``asset()`` function

quick_tour/the_big_picture.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Try your new app by going to ``http://localhost:8000`` in a browser!
5959
Fundamentals: Route, Controller, Response
6060
-----------------------------------------
6161

62-
Our project only has about 15 files, but it's ready to become an sleek API, a robust
62+
Our project only has about 15 files, but it's ready to become a sleek API, a robust
6363
web app, or a microservice. Symfony starts small, but scales with you.
6464

6565
But before we go too far, let's dig into the fundamentals by building our first page.

reference/constraints.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ Validation Constraints Reference
2020
constraints/Ip
2121
constraints/Uuid
2222

23-
constraints/Range
24-
2523
constraints/EqualTo
2624
constraints/NotEqualTo
2725
constraints/IdenticalTo
@@ -30,6 +28,7 @@ Validation Constraints Reference
3028
constraints/LessThanOrEqual
3129
constraints/GreaterThan
3230
constraints/GreaterThanOrEqual
31+
constraints/Range
3332

3433
constraints/Date
3534
constraints/DateTime

reference/constraints/map.rst.inc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ String Constraints
2222
* :doc:`Ip </reference/constraints/Ip>`
2323
* :doc:`Uuid</reference/constraints/Uuid>`
2424

25-
Number Constraints
26-
~~~~~~~~~~~~~~~~~~
27-
28-
* :doc:`Range </reference/constraints/Range>`
29-
3025
Comparison Constraints
3126
~~~~~~~~~~~~~~~~~~~~~~
3227

@@ -38,6 +33,7 @@ Comparison Constraints
3833
* :doc:`LessThanOrEqual </reference/constraints/LessThanOrEqual>`
3934
* :doc:`GreaterThan </reference/constraints/GreaterThan>`
4035
* :doc:`GreaterThanOrEqual </reference/constraints/GreaterThanOrEqual>`
36+
* :doc:`Range </reference/constraints/Range>`
4137

4238
Date Constraints
4339
~~~~~~~~~~~~~~~~

testing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ Learn more
10381038
* :doc:`/components/css_selector`
10391039

10401040
.. _`PHPUnit`: https://phpunit.de/
1041-
.. _`documentation`: https://phpunit.de/manual/current/en/
1041+
.. _`documentation`: https://phpunit.readthedocs.io/
10421042
.. _`PHPUnit Bridge component`: https://symfony.com/components/PHPUnit%20Bridge
10431043
.. _`$_SERVER`: https://php.net/manual/en/reserved.variables.server.php
10441044
.. _`data providers`: https://phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.data-providers

0 commit comments

Comments
 (0)
0