Skip to content

Commit de5c737

Browse files
Merge branch '2.3' into 2.7
* 2.3: Create PULL_REQUEST_TEMPLATE.md Remove duplicate validation in RedirectResponse [Yaml] fix default timezone to be UTC [DependencyInjection] fix dumped YAML string Conflicts: src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php src/Symfony/Component/Yaml/Tests/InlineTest.php
2 parents 31d4548 + f676878 commit de5c737

File tree

7 files changed

+23
-25
lines changed

7 files changed

+23
-25
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
| Q | A
2+
| ------------- | ---
3+
| Bug fix? | [yes|no]
4+
| New feature? | [yes|no]
5+
| BC breaks? | [yes|no]
6+
| Deprecations? | [yes|no]
7+
| Tests pass? | [yes|no]
8+
| Fixed tickets | [comma-separated list of tickets fixed by the PR, if any]
9+
| License | MIT
10+
| Doc PR | [reference to the documentation PR, if any]

CONTRIBUTING.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,6 @@ If you'd like to contribute, please read the following documents:
1212
* [Pull Request Template][3]: Template header to use in your pull request
1313
description;
1414

15-
```markdown
16-
| Q | A
17-
| ------------- | ---
18-
| Bug fix? | yes/no
19-
| New feature? | yes/no
20-
| BC breaks? | no
21-
| Deprecations? | no
22-
| Tests pass? | yes
23-
| Fixed tickets | #1234
24-
| License | MIT
25-
| Doc PR | symfony/symfony-docs#1234
26-
```
27-
2815
* [Backwards Compatibility][4]: Backward compatibility rules.
2916

3017
[1]: https://symfony.com/doc/current/contributing/code/index.html

src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private function addService($id, $definition)
8989
}
9090

9191
if ($definition->getFile()) {
92-
$code .= sprintf(" file: %s\n", $definition->getFile());
92+
$code .= sprintf(" file: %s\n", $this->dumper->dump($definition->getFile()));
9393
}
9494

9595
if ($definition->isSynthetic()) {
@@ -109,11 +109,11 @@ private function addService($id, $definition)
109109
}
110110

111111
if ($definition->getFactoryMethod(false)) {
112-
$code .= sprintf(" factory_method: %s\n", $definition->getFactoryMethod(false));
112+
$code .= sprintf(" factory_method: %s\n", $this->dumper->dump($definition->getFactoryMethod(false)));
113113
}
114114

115115
if ($definition->getFactoryService(false)) {
116-
$code .= sprintf(" factory_service: %s\n", $definition->getFactoryService(false));
116+
$code .= sprintf(" factory_service: %s\n", $this->dumper->dump($definition->getFactoryService(false)));
117117
}
118118

119119
if ($definition->getArguments()) {
@@ -129,7 +129,7 @@ private function addService($id, $definition)
129129
}
130130

131131
if (ContainerInterface::SCOPE_CONTAINER !== $scope = $definition->getScope()) {
132-
$code .= sprintf(" scope: %s\n", $scope);
132+
$code .= sprintf(" scope: %s\n", $this->dumper->dump($scope));
133133
}
134134

135135
if (null !== $decorated = $definition->getDecoratedService()) {

src/Symfony/Component/HttpFoundation/RedirectResponse.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ class RedirectResponse extends Response
3333
*/
3434
public function __construct($url, $status = 302, $headers = array())
3535
{
36-
if (empty($url)) {
37-
throw new \InvalidArgumentException('Cannot redirect to an empty URL.');
38-
}
39-
4036
parent::__construct('', $status, $headers);
4137

4238
$this->setTargetUrl($url);

src/Symfony/Component/Yaml/Inline.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,12 @@ private static function evaluateScalar($scalar, $references = array())
512512
case preg_match('/^(-|\+)?[0-9,]+(\.[0-9]+)?$/', $scalar):
513513
return (float) str_replace(',', '', $scalar);
514514
case preg_match(self::getTimestampRegex(), $scalar):
515-
return strtotime($scalar);
515+
$timeZone = date_default_timezone_get();
516+
date_default_timezone_set('UTC');
517+
$time = strtotime($scalar);
518+
date_default_timezone_set($timeZone);
519+
520+
return $time;
516521
}
517522
default:
518523
return (string) $scalar;

src/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ yaml: |
754754
Billsmer @ 338-4338.
755755
php: |
756756
array(
757-
'invoice' => 34843, 'date' => mktime(0, 0, 0, 1, 23, 2001),
757+
'invoice' => 34843, 'date' => gmmktime(0, 0, 0, 1, 23, 2001),
758758
'bill-to' =>
759759
array( 'given' => 'Chris', 'family' => 'Dumars', 'address' => array( 'lines' => "458 Walkman Dr.\nSuite #292\n", 'city' => 'Royal Oak', 'state' => 'MI', 'postal' => 48046 ) )
760760
, 'ship-to' =>
@@ -879,7 +879,7 @@ yaml: |
879879
php: |
880880
array(
881881
'invoice' => 34843,
882-
'date' => mktime(0, 0, 0, 1, 23, 2001),
882+
'date' => gmmktime(0, 0, 0, 1, 23, 2001),
883883
'total' => 4443.52
884884
)
885885
---

src/Symfony/Component/Yaml/Tests/InlineTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public function getTestsForParse()
206206
array("'on'", 'on'),
207207
array("'off'", 'off'),
208208

209-
array('2007-10-30', mktime(0, 0, 0, 10, 30, 2007)),
209+
array('2007-10-30', gmmktime(0, 0, 0, 10, 30, 2007)),
210210
array('2007-10-30T02:59:43Z', gmmktime(2, 59, 43, 10, 30, 2007)),
211211
array('2007-10-30 02:59:43 Z', gmmktime(2, 59, 43, 10, 30, 2007)),
212212
array('1960-10-30 02:59:43 Z', gmmktime(2, 59, 43, 10, 30, 1960)),

0 commit comments

Comments
 (0)