Skip to content

Commit fed2893

Browse files
committed
Merge branch '5.1'
* 5.1: [ErrorHandler] Return false directly and remove unused variable [OptionsResolver] Assert that the error type is valid in deprecations test [OptionsResolver] Fix deprecation message access [HttpClient] Allow bearer token with colon [Form] Fix custom formats deprecation with HTML5 widgets [Translator] Optional Intl dependency [Contracts][Translation] Optional Intl dependency [ErrorHandler] Escape JSON encoded log context update missing translations arabic [Yaml] simplify the test fix test by letting mock throw the actual expected exception
2 parents c2565c6 + 4c7e155 commit fed2893

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

OptionsResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ public function offsetGet($option, bool $triggerDeprecation = true)
10791079

10801080
// Check whether the option is deprecated
10811081
// and it is provided by the user or is being called from a lazy evaluation
1082-
if ($triggerDeprecation && isset($this->deprecated[$option]) && (isset($this->given[$option]) || ($this->calling && \is_string($this->deprecated[$option])))) {
1082+
if ($triggerDeprecation && isset($this->deprecated[$option]) && (isset($this->given[$option]) || ($this->calling && \is_string($this->deprecated[$option]['message'])))) {
10831083
$deprecation = $this->deprecated[$option];
10841084
$message = $this->deprecated[$option]['message'];
10851085

Tests/OptionsResolverTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,9 @@ public function testDeprecationMessages(\Closure $configureOptions, array $optio
524524
{
525525
$count = 0;
526526
error_clear_last();
527-
set_error_handler(function () use (&$count) {
527+
set_error_handler(function (int $type) use (&$count) {
528+
$this->assertSame(\E_USER_DEPRECATED, $type);
529+
528530
++$count;
529531

530532
return false;

0 commit comments

Comments
 (0)