Skip to content

Commit 29d2101

Browse files
Merge branch '3.4' into 4.0
* 3.4: [DomCrawler] Fix ChoiceFormField::select() PHPDoc [HttpFoundation] add tests for FlashBagInterface::setAll() Check for Hyper terminal on all operating systems. [DI] Don't show internal service id on binding errors Prevent toolbar links color override by css
2 parents 8a96fdc + 601cc08 commit 29d2101

File tree

9 files changed

+50
-11
lines changed

9 files changed

+50
-11
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/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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,11 @@ private function processDefinition(ContainerBuilder $container, $id, Definition
117117
}
118118
}
119119

120+
$definition->setBindings($bindings);
121+
120122
// reset fields with "merge" behavior
121123
$abstract
122-
->setBindings($bindings)
124+
->setBindings(array())
123125
->setArguments(array())
124126
->setMethodCalls(array())
125127
->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;
@@ -250,4 +251,18 @@ public function testMergeReset()
250251
$this->assertEmpty($abstract->getTags());
251252
$this->assertTrue($abstract->isAbstract());
252253
}
254+
255+
public function testBindings()
256+
{
257+
$container = new ContainerBuilder();
258+
$def = $container->register('foo', self::class)->setBindings(array('$toto' => 123));
259+
$def->setInstanceofConditionals(array(parent::class => new ChildDefinition('')));
260+
261+
(new ResolveInstanceofConditionalsPass())->process($container);
262+
263+
$bindings = $container->getDefinition('foo')->getBindings();
264+
$this->assertSame(array('$toto'), array_keys($bindings));
265+
$this->assertInstanceOf(BoundArgument::class, $bindings['$toto']);
266+
$this->assertSame(123, $bindings['$toto']->getValues()[0]);
267+
}
253268
}

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/VarDumper/Dumper/CliDumper.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,13 +541,16 @@ private function hasColorSupport($stream)
541541
return false;
542542
}
543543

544+
if ('Hyper' === getenv('TERM_PROGRAM')) {
545+
return true;
546+
}
547+
544548
if (DIRECTORY_SEPARATOR === '\\') {
545549
return (function_exists('sapi_windows_vt100_support')
546550
&& @sapi_windows_vt100_support($stream))
547551
|| false !== getenv('ANSICON')
548552
|| 'ON' === getenv('ConEmuANSI')
549-
|| 'xterm' === getenv('TERM')
550-
|| 'Hyper' === getenv('TERM_PROGRAM');
553+
|| 'xterm' === getenv('TERM');
551554
}
552555

553556
if (function_exists('stream_isatty')) {

0 commit comments

Comments
 (0)