merged branch lsmith77/forward_compat (PR #2526)
Commits -------b6bf018
tweaked error handling for the forward compatibilitydd606b5
added note about the purpose of this classc1426ba
added locale handling forward compatibility10eed30
added MessageDataCollector forward compatibility Discussion ---------- Forward compat Bug fix: no Feature addition: yes Backwards compatibility break: no Symfony2 tests pass: yes Fixes the following tickets: #2522
This commit is contained in:
commit
60f8525ae5
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Symfony\Bridge\Swiftmailer\DataCollector;
|
||||||
|
|
||||||
|
use Symfony\Bundle\SwiftmailerBundle\DataCollector\MessageDataCollector as BaseMessageDataCollector;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MessageDataCollector.
|
||||||
|
*
|
||||||
|
* Added for forwards compatibility with Symfony2.1
|
||||||
|
*/
|
||||||
|
class MessageDataCollector extends BaseMessageDataCollector
|
||||||
|
{
|
||||||
|
}
|
@ -845,6 +845,24 @@ class Request
|
|||||||
$this->format = $format;
|
$this->format = $format;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setLocale($locale)
|
||||||
|
{
|
||||||
|
if (!$this->hasSession()) {
|
||||||
|
throw new \LogicException('Forward compatibility for Request::setLocale() requires the session to be set.');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->session->setLocale($locale);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLocale()
|
||||||
|
{
|
||||||
|
if (!$this->hasSession()) {
|
||||||
|
throw new \LogicException('Forward compatibility for Request::getLocale() requires the session to be set.');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->session->getLocale();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether the method is safe or not.
|
* Checks whether the method is safe or not.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user