From 2200b0c178572be1408d99437c91c3a856b92c8c Mon Sep 17 00:00:00 2001 From: Calin Mihai Pristavu Date: Wed, 17 Feb 2016 16:19:09 +0200 Subject: [PATCH 1/5] [Config] Add suggest to composer.json for symfony/yaml --- src/Symfony/Component/Config/composer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Symfony/Component/Config/composer.json b/src/Symfony/Component/Config/composer.json index 28252b13ef..f1633c1c80 100644 --- a/src/Symfony/Component/Config/composer.json +++ b/src/Symfony/Component/Config/composer.json @@ -19,6 +19,9 @@ "php": ">=5.3.9", "symfony/filesystem": "~2.3" }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, "autoload": { "psr-4": { "Symfony\\Component\\Config\\": "" }, "exclude-from-classmap": [ From b1bb1352495310f786ee7cf5fef148a4c24658e7 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 17 Feb 2016 08:59:48 +0100 Subject: [PATCH 2/5] [DependencyInjection] fix dumped YAML string --- .../Component/DependencyInjection/Dumper/YamlDumper.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php index 84ad6f872a..480857ee64 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php @@ -88,7 +88,7 @@ class YamlDumper extends Dumper } if ($definition->getFile()) { - $code .= sprintf(" file: %s\n", $definition->getFile()); + $code .= sprintf(" file: %s\n", $this->dumper->dump($definition->getFile())); } if ($definition->isSynthetic()) { @@ -108,11 +108,11 @@ class YamlDumper extends Dumper } if ($definition->getFactoryMethod()) { - $code .= sprintf(" factory_method: %s\n", $definition->getFactoryMethod()); + $code .= sprintf(" factory_method: %s\n", $this->dumper->dump($definition->getFactoryMethod())); } if ($definition->getFactoryService()) { - $code .= sprintf(" factory_service: %s\n", $definition->getFactoryService()); + $code .= sprintf(" factory_service: %s\n", $this->dumper->dump($definition->getFactoryService())); } if ($definition->getArguments()) { @@ -128,7 +128,7 @@ class YamlDumper extends Dumper } if (ContainerInterface::SCOPE_CONTAINER !== $scope = $definition->getScope()) { - $code .= sprintf(" scope: %s\n", $scope); + $code .= sprintf(" scope: %s\n", $this->dumper->dump($scope)); } if ($callable = $definition->getConfigurator()) { From e9ee877e4b2ee4362766737bf24f1129c0cb590c Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 17 Feb 2016 22:15:58 +0100 Subject: [PATCH 3/5] [Yaml] fix default timezone to be UTC --- src/Symfony/Component/Yaml/Inline.php | 7 ++++++- .../Yaml/Tests/Fixtures/YtsSpecificationExamples.yml | 4 ++-- src/Symfony/Component/Yaml/Tests/InlineTest.php | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Yaml/Inline.php b/src/Symfony/Component/Yaml/Inline.php index eafcbc7ab0..5f15e3c5b4 100644 --- a/src/Symfony/Component/Yaml/Inline.php +++ b/src/Symfony/Component/Yaml/Inline.php @@ -475,7 +475,12 @@ class Inline case preg_match('/^(-|\+)?[0-9,]+(\.[0-9]+)?$/', $scalar): return (float) str_replace(',', '', $scalar); case preg_match(self::getTimestampRegex(), $scalar): - return strtotime($scalar); + $timeZone = date_default_timezone_get(); + date_default_timezone_set('UTC'); + $time = strtotime($scalar); + date_default_timezone_set($timeZone); + + return $time; } default: return (string) $scalar; diff --git a/src/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml b/src/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml index a06df7fb31..cbbb257a02 100644 --- a/src/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml +++ b/src/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml @@ -752,7 +752,7 @@ yaml: | Billsmer @ 338-4338. php: | array( - 'invoice' => 34843, 'date' => mktime(0, 0, 0, 1, 23, 2001), + 'invoice' => 34843, 'date' => gmmktime(0, 0, 0, 1, 23, 2001), 'bill-to' => array( 'given' => 'Chris', 'family' => 'Dumars', 'address' => array( 'lines' => "458 Walkman Dr.\nSuite #292\n", 'city' => 'Royal Oak', 'state' => 'MI', 'postal' => 48046 ) ) , 'ship-to' => @@ -877,7 +877,7 @@ yaml: | php: | array( 'invoice' => 34843, - 'date' => mktime(0, 0, 0, 1, 23, 2001), + 'date' => gmmktime(0, 0, 0, 1, 23, 2001), 'total' => 4443.52 ) --- diff --git a/src/Symfony/Component/Yaml/Tests/InlineTest.php b/src/Symfony/Component/Yaml/Tests/InlineTest.php index b259000e53..255928d16d 100644 --- a/src/Symfony/Component/Yaml/Tests/InlineTest.php +++ b/src/Symfony/Component/Yaml/Tests/InlineTest.php @@ -202,7 +202,7 @@ class InlineTest extends \PHPUnit_Framework_TestCase "'on'" => 'on', "'off'" => 'off', - '2007-10-30' => mktime(0, 0, 0, 10, 30, 2007), + '2007-10-30' => gmmktime(0, 0, 0, 10, 30, 2007), '2007-10-30T02:59:43Z' => gmmktime(2, 59, 43, 10, 30, 2007), '2007-10-30 02:59:43 Z' => gmmktime(2, 59, 43, 10, 30, 2007), '1960-10-30 02:59:43 Z' => gmmktime(2, 59, 43, 10, 30, 1960), From d27c4f4d68691ff4c1017b59b3bcd54ddec57330 Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Thu, 18 Feb 2016 01:47:59 +0100 Subject: [PATCH 4/5] Remove duplicate validation in RedirectResponse --- src/Symfony/Component/HttpFoundation/RedirectResponse.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/RedirectResponse.php b/src/Symfony/Component/HttpFoundation/RedirectResponse.php index a21eb5cc51..e7f47aa259 100644 --- a/src/Symfony/Component/HttpFoundation/RedirectResponse.php +++ b/src/Symfony/Component/HttpFoundation/RedirectResponse.php @@ -33,10 +33,6 @@ class RedirectResponse extends Response */ public function __construct($url, $status = 302, $headers = array()) { - if (empty($url)) { - throw new \InvalidArgumentException('Cannot redirect to an empty URL.'); - } - parent::__construct('', $status, $headers); $this->setTargetUrl($url); From ac8f8f8964a06ee65079a1c3e7ea8b873c43e6b1 Mon Sep 17 00:00:00 2001 From: Colin O'Dell Date: Wed, 17 Feb 2016 13:03:29 -0500 Subject: [PATCH 5/5] Create PULL_REQUEST_TEMPLATE.md --- .github/PULL_REQUEST_TEMPLATE.md | 10 ++++++++++ CONTRIBUTING.md | 13 ------------- 2 files changed, 10 insertions(+), 13 deletions(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..1118d9caa2 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,10 @@ +| Q | A +| ------------- | --- +| Bug fix? | [yes|no] +| New feature? | [yes|no] +| BC breaks? | [yes|no] +| Deprecations? | [yes|no] +| Tests pass? | [yes|no] +| Fixed tickets | [comma-separated list of tickets fixed by the PR, if any] +| License | MIT +| Doc PR | [reference to the documentation PR, if any] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4def05128a..170c0cadac 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,19 +12,6 @@ If you'd like to contribute, please read the following documents: * [Pull Request Template][3]: Template header to use in your pull request description; -```markdown -| Q | A -| ------------- | --- -| Bug fix? | yes/no -| New feature? | yes/no -| BC breaks? | no -| Deprecations? | no -| Tests pass? | yes -| Fixed tickets | #1234 -| License | MIT -| Doc PR | symfony/symfony-docs#1234 -``` - * [Backwards Compatibility][4]: Backward compatibility rules. [1]: http://symfony.com/doc/current/contributing/code/index.html