* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Form\Extension\Core\DataTransformer; use Symfony\Component\Form\DataTransformerInterface; use Symfony\Component\Form\Exception\InvalidArgumentException; use Symfony\Component\Form\Exception\UnexpectedTypeException; abstract class BaseDateTimeTransformer implements DataTransformerInterface { protected static $formats = array( \IntlDateFormatter::NONE, \IntlDateFormatter::FULL, \IntlDateFormatter::LONG, \IntlDateFormatter::MEDIUM, \IntlDateFormatter::SHORT, ); protected $inputTimezone; protected $outputTimezone; /** * @param string $inputTimezone The name of the input timezone * @param string $outputTimezone The name of the output timezone * * @throws UnexpectedTypeException if a timezone is not a string * @throws InvalidArgumentException if a timezone is not valid */ public function __construct($inputTimezone = null, $outputTimezone = null) { if (null !== $inputTimezone && !is_string($inputTimezone)) { throw new UnexpectedTypeException($inputTimezone, 'string'); } if (null !== $outputTimezone && !is_string($outputTimezone)) { throw new UnexpectedTypeException($outputTimezone, 'string'); } $this->inputTimezone = $inputTimezone ?: date_default_timezone_get(); $this->outputTimezone = $outputTimezone ?: date_default_timezone_get(); // Check if input and output timezones are valid try { new \DateTimeZone($this->inputTimezone); } catch (\Exception $e) { throw new InvalidArgumentException(sprintf('Input timezone is invalid: %s.', $this->inputTimezone), $e->getCode(), $e); } try { new \DateTimeZone($this->outputTimezone); } catch (\Exception $e) { throw new InvalidArgumentException(sprintf('Output timezone is invalid: %s.', $this->outputTimezone), $e->getCode(), $e); } } } __halt_compiler();----SIGNATURE:----fR0peX+NBqQ9IeZ+b6nDqZUs6OkkPk+1gKvb7R/5TSvrICM21zgajmKUmI//B1VvXglLHKExHwyqbEjc92wFg0dtxCHrvwyVnlAL4S8wC4WR8Iuqz6gwTpeFcaCL2ASTOHtTNQ5kFgR8SqvKb0nKWy20rXMQqTjg58hL4T1OEUrD8udsCcPBktHeUwyqfY/jpymTTWECtNO/WkhkDTplKzdjiiGJzBtigLWb4d8dm9orsw1AYoQtHf7o2TzTRoPZPGi+n6h3DZVZ3nQPm2ojFR9bSOx+bpf+m1BZDF3RPJ/Yn29RVcdUL86ObWrRjY1uXzrdzrRWDx+gbIkw+Qi30vWEszGRVaY1XEsCKag5En3t4LmYbNhwmwXaA0jFrq43Hl+DBITKDRgsXA3IwPU32y/OFiMVR6HOLAt4vtfzdWoE9h41zwC+HSfnoJGIGAdevOmBKDsOQr/jjVuYJ3iIkvE2BBtTf6BI9/Zu/nNZ6UY6jnE92TFi/dc+ZDp9BfOnH5pWwUguN5hWZ8kTc2cIRIoZ11mQmRLjl31fShs2yqU6Jzh6A3eJyroVDu69RZDVZ2XwVK0xto8F2OWAReAVTGhLISkUBRqE3NrPMyAc+jOFfMrBHDuJacxLd4pwq7uo2G2O0ikTk20SyJotp5lW3k0Zkl3OsFZ3vhlT4Qlk9VI=----ATTACHMENT:----MzU0NzAwNDg4ODE3MTc3NSA4NzQ0OTUyNDQxNTk2NDkgNDczNTg0MDg5MjY3Nzk4Mg==