Merge branch '2.8' into 3.4

* 2.8:
  [DomCrawler] Fix ChoiceFormField::select() PHPDoc
  [HttpFoundation] add tests for FlashBagInterface::setAll()
  Check for Hyper terminal on all operating systems.
  Prevent toolbar links color override by css
This commit is contained in:
Nicolas Grekas 2018-07-05 13:53:23 +02:00
commit 601cc0827d
7 changed files with 32 additions and 10 deletions

View File

@ -311,13 +311,16 @@ class DeprecationErrorHandler
return false;
}
if ('Hyper' === getenv('TERM_PROGRAM')) {
return true;
}
if (DIRECTORY_SEPARATOR === '\\') {
return (function_exists('sapi_windows_vt100_support')
&& sapi_windows_vt100_support(STDOUT))
|| false !== getenv('ANSICON')
|| 'ON' === getenv('ConEmuANSI')
|| 'xterm' === getenv('TERM')
|| 'Hyper' === getenv('TERM_PROGRAM');
|| 'xterm' === getenv('TERM');
}
if (function_exists('stream_isatty')) {

View File

@ -160,11 +160,11 @@
margin-bottom: 0;
}
.sf-toolbar-block .sf-toolbar-info-piece a {
div.sf-toolbar .sf-toolbar-block .sf-toolbar-info-piece a {
color: #99CDD8;
text-decoration: underline;
}
.sf-toolbar-block .sf-toolbar-info-piece a:hover {
div.sf-toolbar .sf-toolbar-block a:hover {
text-decoration: none;
}

View File

@ -93,13 +93,16 @@ class StreamOutput extends Output
*/
protected function hasColorSupport()
{
if ('Hyper' === getenv('TERM_PROGRAM')) {
return true;
}
if (DIRECTORY_SEPARATOR === '\\') {
return (function_exists('sapi_windows_vt100_support')
&& @sapi_windows_vt100_support($this->stream))
|| false !== getenv('ANSICON')
|| 'ON' === getenv('ConEmuANSI')
|| 'xterm' === getenv('TERM')
|| 'Hyper' === getenv('TERM_PROGRAM');
|| 'xterm' === getenv('TERM');
}
if (function_exists('stream_isatty')) {

View File

@ -269,7 +269,7 @@ class SymfonyStyle extends OutputStyle
{
$progressBar = parent::createProgressBar($max);
if ('\\' !== DIRECTORY_SEPARATOR || 'Hyper' === getenv('TERM_PROGRAM')) {
if ('\\' !== DIRECTORY_SEPARATOR || 'Hyper' === getenv('TERM_PROGRAM')) {
$progressBar->setEmptyBarCharacter('░'); // light shade character \u2591
$progressBar->setProgressCharacter('');
$progressBar->setBarCharacter('▓'); // dark shade character \u2593

View File

@ -75,7 +75,7 @@ class ChoiceFormField extends FormField
/**
* Sets the value of the field.
*
* @param string $value The value of the field
* @param string|array $value The value of the field
*/
public function select($value)
{

View File

@ -124,6 +124,19 @@ class FlashBagTest extends TestCase
$this->assertEquals(array('notice'), $this->bag->keys());
}
public function testSetAll()
{
$this->bag->add('one_flash', 'Foo');
$this->bag->add('another_flash', 'Bar');
$this->assertTrue($this->bag->has('one_flash'));
$this->assertTrue($this->bag->has('another_flash'));
$this->bag->setAll(array('unique_flash' => 'FooBar'));
$this->assertFalse($this->bag->has('one_flash'));
$this->assertFalse($this->bag->has('another_flash'));
$this->assertSame(array('unique_flash' => 'FooBar'), $this->bag->all());
$this->assertSame(array(), $this->bag->all());
}
public function testPeekAll()
{
$this->bag->set('notice', 'Foo');

View File

@ -541,13 +541,16 @@ class CliDumper extends AbstractDumper
return false;
}
if ('Hyper' === getenv('TERM_PROGRAM')) {
return true;
}
if (DIRECTORY_SEPARATOR === '\\') {
return (function_exists('sapi_windows_vt100_support')
&& @sapi_windows_vt100_support($stream))
|| false !== getenv('ANSICON')
|| 'ON' === getenv('ConEmuANSI')
|| 'xterm' === getenv('TERM')
|| 'Hyper' === getenv('TERM_PROGRAM');
|| 'xterm' === getenv('TERM');
}
if (function_exists('stream_isatty')) {