Skip to content

Commit f42057a

Browse files
committed
Merge branch '2.8' into 3.0
* 2.8: [#6228] backport to the 2.3 branch Update form_collections.rst removed unnecesary exception form repository Replace references of PSR-0 with PSR-4 change translation getMessages() to getCatalogue() Update testing.rst add versionadded directive for range type Typo in default session save_path [book] fixes typo about redirect status codes in the controller chapter. Update major_version.rst
2 parents 06c76aa + 0d92394 commit f42057a

File tree

9 files changed

+16
-20
lines changed

9 files changed

+16
-20
lines changed

book/controller.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ If you want to redirect the user to another page, use the ``redirectToRoute()``
438438
return $this->redirectToRoute('homepage');
439439

440440
// redirectToRoute is equivalent to using redirect() and generateUrl() together:
441-
// return $this->redirect($this->generateUrl('homepage'), 301);
441+
// return $this->redirect($this->generateUrl('homepage'));
442442
}
443443

444444
Or, if you want to redirect externally, just use ``redirect()`` and pass it the URL::

book/testing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ section:
860860
Learn more
861861
----------
862862

863-
* The :doc:`chapter about tests in the Symfony Framework Best Practices </best_practices/tests>`
863+
* :doc:`The chapter about tests in the Symfony Framework Best Practices </best_practices/tests>`
864864
* :doc:`/components/dom_crawler`
865865
* :doc:`/components/css_selector`
866866
* :doc:`/cookbook/testing/http_authentication`

components/translation/usage.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,11 @@ In case you want to use the same translation catalogue outside your application
376376
(e.g. use translation on the client side), it's possible to fetch raw translation
377377
messages. Just specify the required locale::
378378

379-
$messages = $translator->getMessages('fr_FR');
379+
$catalogue = $translator->getCatalogue('fr_FR');
380+
$messages = $catalogue->all();
381+
while ($catalogue = $catalogue->getFallbackCatalogue()) {
382+
$messages = array_replace_recursive($catalogue->all(), $messages);
383+
}
380384

381385
The ``$messages`` variable will have the following structure::
382386

cookbook/form/form_collections.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ the relationship between the removed ``Tag`` and ``Task`` object.
689689
$originalTags->add($tag);
690690
}
691691

692-
$editForm = $this->createForm(new TaskType::class, $task);
692+
$editForm = $this->createForm(TaskType::class, $task);
693693

694694
$editForm->handleRequest($request);
695695

cookbook/security/entity_provider.rst

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -430,29 +430,18 @@ interface only requires one method: ``loadUserByUsername($username)``::
430430

431431
use Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface;
432432
use Symfony\Component\Security\Core\User\UserInterface;
433-
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
434433
use Doctrine\ORM\EntityRepository;
435434

436435
class UserRepository extends EntityRepository implements UserLoaderInterface
437436
{
438437
public function loadUserByUsername($username)
439438
{
440-
$user = $this->createQueryBuilder('u')
439+
return $this->createQueryBuilder('u')
441440
->where('u.username = :username OR u.email = :email')
442441
->setParameter('username', $username)
443442
->setParameter('email', $username)
444443
->getQuery()
445444
->getOneOrNullResult();
446-
447-
if (null === $user) {
448-
$message = sprintf(
449-
'Unable to find an active admin AppBundle:User object identified by "%s".',
450-
$username
451-
);
452-
throw new UsernameNotFoundException($message);
453-
}
454-
455-
return $user;
456445
}
457446
}
458447

cookbook/upgrade/major_version.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Next, use Composer to download new versions of the libraries:
134134

135135
.. code-block:: bash
136136
137-
$ composer update --with-dependencies symfony/symfony
137+
$ composer update symfony/symfony
138138
139139
.. include:: /cookbook/upgrade/_update_dep_errors.rst.inc
140140

create_framework/http_foundation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ version may vary).
138138
``vendor/autoload.php`` file that allows any class to be easily
139139
`autoloaded`_. Without autoloading, you would need to require the file
140140
where a class is defined before being able to use it. But thanks to
141-
`PSR-0`_, we can just let Composer and PHP do the hard work for us.
141+
`PSR-4`_, we can just let Composer and PHP do the hard work for us.
142142

143143
Now, let's rewrite our application by using the ``Request`` and the
144144
``Response`` classes::
@@ -309,5 +309,5 @@ applications using it (like `Symfony`_, `Drupal 8`_, `phpBB 4`_, `ezPublish
309309
.. _`Midgard CMS`: http://www.midgard-project.org/
310310
.. _`Zikula`: http://zikula.org/
311311
.. _`autoloaded`: http://php.net/autoload
312-
.. _`PSR-0`: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
312+
.. _`PSR-4`: http://www.php-fig.org/psr/psr-4/
313313
.. _`more`: http://symfony.com/components/HttpFoundation

reference/configuration/framework.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ start and depends on `gc_divisor`_ and `gc_probability`_.
808808
save_path
809809
.........
810810

811-
**type**: ``string`` **default**: ``%kernel.cache.dir%/sessions``
811+
**type**: ``string`` **default**: ``%kernel.cache_dir%/sessions``
812812

813813
This determines the argument to be passed to the save handler. If you choose
814814
the default file handler, this is the path where the session files are created.

reference/forms/types/range.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
RangeType Field
55
===============
66

7+
.. versionadded:: 2.8
8+
The ``range`` type was introduced in Symfony 2.8.
9+
710
The ``RangeType`` field is a slider that is rendered using the HTML5
811
``<input type="range" />`` tag.
912

0 commit comments

Comments
 (0)