Skip to content

Commit 7135aa4

Browse files
Merge branch '4.1'
* 4.1: [DomCrawler] Fix ChoiceFormField::select() PHPDoc [Security] LdapUserProvider uidKey could be null [HttpFoundation] add tests for FlashBagInterface::setAll() Check for Hyper terminal on all operating systems. [DI] Don't show internal service id on binding errors Fix a bug when having more than one named handler per message subscriber Prevent toolbar links color override by css add conflict for non-compatible TwigBridge version
2 parents 04b2c2d + e308c93 commit 7135aa4

File tree

13 files changed

+64
-14
lines changed

13 files changed

+64
-14
lines changed

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,13 +311,16 @@ private static function hasColorSupport()
311311
return false;
312312
}
313313

314+
if ('Hyper' === getenv('TERM_PROGRAM')) {
315+
return true;
316+
}
317+
314318
if (DIRECTORY_SEPARATOR === '\\') {
315319
return (function_exists('sapi_windows_vt100_support')
316320
&& sapi_windows_vt100_support(STDOUT))
317321
|| false !== getenv('ANSICON')
318322
|| 'ON' === getenv('ConEmuANSI')
319-
|| 'xterm' === getenv('TERM')
320-
|| 'Hyper' === getenv('TERM_PROGRAM');
323+
|| 'xterm' === getenv('TERM');
321324
}
322325

323326
if (function_exists('stream_isatty')) {

src/Symfony/Bundle/FrameworkBundle/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
"symfony/serializer": "<4.1",
7272
"symfony/stopwatch": "<3.4",
7373
"symfony/translation": "<3.4",
74+
"symfony/twig-bridge": "<4.1.1",
7475
"symfony/validator": "<4.1",
7576
"symfony/workflow": "<4.1"
7677
},

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,11 @@
160160
margin-bottom: 0;
161161
}
162162

163-
.sf-toolbar-block .sf-toolbar-info-piece a {
163+
div.sf-toolbar .sf-toolbar-block .sf-toolbar-info-piece a {
164164
color: #99CDD8;
165165
text-decoration: underline;
166166
}
167-
.sf-toolbar-block .sf-toolbar-info-piece a:hover {
167+
div.sf-toolbar .sf-toolbar-block a:hover {
168168
text-decoration: none;
169169
}
170170

src/Symfony/Component/Console/Output/StreamOutput.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,16 @@ protected function doWrite($message, $newline)
9393
*/
9494
protected function hasColorSupport()
9595
{
96+
if ('Hyper' === getenv('TERM_PROGRAM')) {
97+
return true;
98+
}
99+
96100
if (DIRECTORY_SEPARATOR === '\\') {
97101
return (function_exists('sapi_windows_vt100_support')
98102
&& @sapi_windows_vt100_support($this->stream))
99103
|| false !== getenv('ANSICON')
100104
|| 'ON' === getenv('ConEmuANSI')
101-
|| 'xterm' === getenv('TERM')
102-
|| 'Hyper' === getenv('TERM_PROGRAM');
105+
|| 'xterm' === getenv('TERM');
103106
}
104107

105108
if (function_exists('stream_isatty')) {

src/Symfony/Component/Console/Style/SymfonyStyle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ public function createProgressBar($max = 0)
269269
{
270270
$progressBar = parent::createProgressBar($max);
271271

272-
if ('\\' !== DIRECTORY_SEPARATOR || 'Hyper' === getenv('TERM_PROGRAM')) {
272+
if ('\\' !== DIRECTORY_SEPARATOR || 'Hyper' === getenv('TERM_PROGRAM')) {
273273
$progressBar->setEmptyBarCharacter(''); // light shade character \u2591
274274
$progressBar->setProgressCharacter('');
275275
$progressBar->setBarCharacter(''); // dark shade character \u2593

src/Symfony/Component/DependencyInjection/Compiler/ResolveInstanceofConditionalsPass.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,11 @@ private function processDefinition(ContainerBuilder $container, $id, Definition
123123
}
124124

125125
$definition->setMethodCalls(array_merge($instanceofCalls, $definition->getMethodCalls()));
126+
$definition->setBindings($bindings);
126127

127128
// reset fields with "merge" behavior
128129
$abstract
129-
->setBindings($bindings)
130+
->setBindings(array())
130131
->setArguments(array())
131132
->setMethodCalls(array())
132133
->setDecoratedService(null)

src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInstanceofConditionalsPassTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\DependencyInjection\Tests\Compiler;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Component\DependencyInjection\Argument\BoundArgument;
1516
use Symfony\Component\DependencyInjection\ChildDefinition;
1617
use Symfony\Component\DependencyInjection\Compiler\ResolveInstanceofConditionalsPass;
1718
use Symfony\Component\DependencyInjection\Compiler\ResolveChildDefinitionsPass;
@@ -268,4 +269,18 @@ public function testMergeReset()
268269
$this->assertEmpty($abstract->getTags());
269270
$this->assertTrue($abstract->isAbstract());
270271
}
272+
273+
public function testBindings()
274+
{
275+
$container = new ContainerBuilder();
276+
$def = $container->register('foo', self::class)->setBindings(array('$toto' => 123));
277+
$def->setInstanceofConditionals(array(parent::class => new ChildDefinition('')));
278+
279+
(new ResolveInstanceofConditionalsPass())->process($container);
280+
281+
$bindings = $container->getDefinition('foo')->getBindings();
282+
$this->assertSame(array('$toto'), array_keys($bindings));
283+
$this->assertInstanceOf(BoundArgument::class, $bindings['$toto']);
284+
$this->assertSame(123, $bindings['$toto']->getValues()[0]);
285+
}
271286
}

src/Symfony/Component/DomCrawler/Field/ChoiceFormField.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function isDisabled()
7575
/**
7676
* Sets the value of the field.
7777
*
78-
* @param string $value The value of the field
78+
* @param string|array $value The value of the field
7979
*/
8080
public function select($value)
8181
{

src/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,19 @@ public function testKeys()
124124
$this->assertEquals(array('notice'), $this->bag->keys());
125125
}
126126

127+
public function testSetAll()
128+
{
129+
$this->bag->add('one_flash', 'Foo');
130+
$this->bag->add('another_flash', 'Bar');
131+
$this->assertTrue($this->bag->has('one_flash'));
132+
$this->assertTrue($this->bag->has('another_flash'));
133+
$this->bag->setAll(array('unique_flash' => 'FooBar'));
134+
$this->assertFalse($this->bag->has('one_flash'));
135+
$this->assertFalse($this->bag->has('another_flash'));
136+
$this->assertSame(array('unique_flash' => 'FooBar'), $this->bag->all());
137+
$this->assertSame(array(), $this->bag->all());
138+
}
139+
127140
public function testPeekAll()
128141
{
129142
$this->bag->set('notice', 'Foo');

src/Symfony/Component/Messenger/DependencyInjection/MessengerPass.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,13 @@ private function registerHandlers(ContainerBuilder $container, array $busIds)
128128
if ('__invoke' !== $method) {
129129
$wrapperDefinition = (new Definition('callable'))->addArgument(array(new Reference($serviceId), $method))->setFactory('Closure::fromCallable');
130130

131-
$definitions[$serviceId = '.messenger.method_on_object_wrapper.'.ContainerBuilder::hash($messageClass.':'.$messagePriority.':'.$serviceId.':'.$method)] = $wrapperDefinition;
131+
$definitions[$definitionId = '.messenger.method_on_object_wrapper.'.ContainerBuilder::hash($messageClass.':'.$messagePriority.':'.$serviceId.':'.$method)] = $wrapperDefinition;
132+
} else {
133+
$definitionId = $serviceId;
132134
}
133135

134136
foreach ($handlerBuses as $handlerBus) {
135-
$handlersByBusAndMessage[$handlerBus][$messageClass][$messagePriority][] = $serviceId;
137+
$handlersByBusAndMessage[$handlerBus][$messageClass][$messagePriority][] = $definitionId;
136138
}
137139
}
138140
}

0 commit comments

Comments
 (0)