Skip to content

Commit e308c93

Browse files
Merge branch '4.0' into 4.1
* 4.0: [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 Prevent toolbar links color override by css
2 parents 44d4330 + 29d2101 commit e308c93

File tree

10 files changed

+54
-12
lines changed

10 files changed

+54
-12
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: 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/Security/Core/User/LdapUserProvider.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ class LdapUserProvider implements UserProviderInterface
3535
private $defaultSearch;
3636
private $passwordAttribute;
3737

38-
public function __construct(LdapInterface $ldap, string $baseDn, string $searchDn = null, string $searchPassword = null, array $defaultRoles = array(), string $uidKey = 'sAMAccountName', string $filter = '({uid_key}={username})', string $passwordAttribute = null)
38+
public function __construct(LdapInterface $ldap, string $baseDn, string $searchDn = null, string $searchPassword = null, array $defaultRoles = array(), ?string $uidKey = 'sAMAccountName', string $filter = '({uid_key}={username})', string $passwordAttribute = null)
3939
{
40+
if (null === $uidKey) {
41+
$uidKey = 'sAMAccountName';
42+
}
43+
4044
$this->ldap = $ldap;
4145
$this->baseDn = $baseDn;
4246
$this->searchDn = $searchDn;

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)