Skip to content
Permalink
Browse files

Merge branch '3.4' into 4.2

* 3.4:
  Add a missing quote in getValue() DocBlock
  [HttpFoundation] Fixed case-sensitive handling of cache-control header in RedirectResponse constructor.
  minor: ChoiceType callable deprecation after/before seems wrong
  • Loading branch information...
nicolas-grekas committed Jun 6, 2019
2 parents 687f775 + 04c6c92 commit 05eb388c264dd9fd027a5cfcde02ffc7afea607c
@@ -297,19 +297,17 @@ Form
`ArrayAccess` in `ResizeFormListener::preSubmit` method has been removed.

* Using callable strings as choice options in ChoiceType is not supported
anymore in favor of passing PropertyPath instances.
anymore.

Before:

```php
'choice_value' => new PropertyPath('range'),
'choice_label' => 'strtoupper',
```

After:

```php
'choice_value' => 'range',
'choice_label' => function ($choice) {
return strtoupper($choice);
},
@@ -42,7 +42,7 @@ public function __construct(?string $url, int $status = 302, array $headers = []
throw new \InvalidArgumentException(sprintf('The HTTP status code is not a redirect ("%s" given).', $status));
}
if (301 == $status && !\array_key_exists('cache-control', $headers)) {
if (301 == $status && !\array_key_exists('cache-control', array_change_key_case($headers, \CASE_LOWER))) {
$this->headers->remove('cache-control');
}
}
@@ -91,6 +91,10 @@ public function testCacheHeaders()
$this->assertFalse($response->headers->hasCacheControlDirective('no-cache'));
$this->assertTrue($response->headers->hasCacheControlDirective('max-age'));
$response = new RedirectResponse('foo.bar', 301, ['Cache-Control' => 'max-age=86400']);
$this->assertFalse($response->headers->hasCacheControlDirective('no-cache'));
$this->assertTrue($response->headers->hasCacheControlDirective('max-age'));
$response = new RedirectResponse('foo.bar', 302);
$this->assertTrue($response->headers->hasCacheControlDirective('no-cache'));
}
@@ -58,7 +58,7 @@ public function setValue(&$objectOrArray, $propertyPath, $value);
*
* $propertyAccessor = PropertyAccess::createPropertyAccessor();
*
* echo $propertyAccessor->getValue($object, 'child.name);
* echo $propertyAccessor->getValue($object, 'child.name');
* // equals echo $object->getChild()->getName();
*
* This method first tries to find a public getter for each property in the

0 comments on commit 05eb388

Please sign in to comment.
You can’t perform that action at this time.