Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ddf6207

Browse files
Merge branch '3.0'
* 3.0: Create PULL_REQUEST_TEMPLATE.md Remove duplicate validation in RedirectResponse [Yaml] fix default timezone to be UTC [DependencyInjection] fix dumped YAML string [Config] Add suggest to composer.json for symfony/yaml
2 parents e837b34 + b88f031 commit ddf6207

File tree

8 files changed

+23
-22
lines changed

8 files changed

+23
-22
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/Config/composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
"php": ">=5.5.9",
2020
"symfony/filesystem": "~2.8|~3.0"
2121
},
22+
"suggest": {
23+
"symfony/yaml": "To use the yaml reference dumper"
24+
},
2225
"autoload": {
2326
"psr-4": { "Symfony\\Component\\Config\\": "" },
2427
"exclude-from-classmap": [

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

Lines changed: 1 addition & 1 deletion
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()) {

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
@@ -569,7 +569,12 @@ private static function evaluateScalar($scalar, $references = array())
569569
case preg_match('/^(-|\+)?[0-9,]+(\.[0-9]+)?$/', $scalar):
570570
return (float) str_replace(',', '', $scalar);
571571
case preg_match(self::getTimestampRegex(), $scalar):
572-
return strtotime($scalar);
572+
$timeZone = date_default_timezone_get();
573+
date_default_timezone_set('UTC');
574+
$time = strtotime($scalar);
575+
date_default_timezone_set($timeZone);
576+
577+
return $time;
573578
}
574579
default:
575580
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
@@ -285,7 +285,7 @@ public function getTestsForParse()
285285
array("'on'", 'on'),
286286
array("'off'", 'off'),
287287

288-
array('2007-10-30', mktime(0, 0, 0, 10, 30, 2007)),
288+
array('2007-10-30', gmmktime(0, 0, 0, 10, 30, 2007)),
289289
array('2007-10-30T02:59:43Z', gmmktime(2, 59, 43, 10, 30, 2007)),
290290
array('2007-10-30 02:59:43 Z', gmmktime(2, 59, 43, 10, 30, 2007)),
291291
array('1960-10-30 02:59:43 Z', gmmktime(2, 59, 43, 10, 30, 1960)),

0 commit comments

Comments
 (0)