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 123d5aa755..a33841f674 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]: https://symfony.com/doc/current/contributing/code/index.html diff --git a/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php index 0d8edb29d4..3acac1c9ad 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php @@ -89,7 +89,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()) { @@ -109,11 +109,11 @@ class YamlDumper extends Dumper } if ($definition->getFactoryMethod(false)) { - $code .= sprintf(" factory_method: %s\n", $definition->getFactoryMethod(false)); + $code .= sprintf(" factory_method: %s\n", $this->dumper->dump($definition->getFactoryMethod(false))); } if ($definition->getFactoryService(false)) { - $code .= sprintf(" factory_service: %s\n", $definition->getFactoryService(false)); + $code .= sprintf(" factory_service: %s\n", $this->dumper->dump($definition->getFactoryService(false))); } if ($definition->getArguments()) { @@ -129,7 +129,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 (null !== $decorated = $definition->getDecoratedService()) { 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); diff --git a/src/Symfony/Component/Yaml/Inline.php b/src/Symfony/Component/Yaml/Inline.php index 410e23c598..fdd82d91f0 100644 --- a/src/Symfony/Component/Yaml/Inline.php +++ b/src/Symfony/Component/Yaml/Inline.php @@ -512,7 +512,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 d69e97a1a5..ec1c4c3a1a 100644 --- a/src/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml +++ b/src/Symfony/Component/Yaml/Tests/Fixtures/YtsSpecificationExamples.yml @@ -754,7 +754,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' => @@ -879,7 +879,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 522d77053d..66da12c1dd 100644 --- a/src/Symfony/Component/Yaml/Tests/InlineTest.php +++ b/src/Symfony/Component/Yaml/Tests/InlineTest.php @@ -206,7 +206,7 @@ class InlineTest extends \PHPUnit_Framework_TestCase array("'on'", 'on'), array("'off'", 'off'), - array('2007-10-30', mktime(0, 0, 0, 10, 30, 2007)), + array('2007-10-30', gmmktime(0, 0, 0, 10, 30, 2007)), array('2007-10-30T02:59:43Z', gmmktime(2, 59, 43, 10, 30, 2007)), array('2007-10-30 02:59:43 Z', gmmktime(2, 59, 43, 10, 30, 2007)), array('1960-10-30 02:59:43 Z', gmmktime(2, 59, 43, 10, 30, 1960)),