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
This commit is contained in:
commit
29d2101891
@ -311,13 +311,16 @@ class DeprecationErrorHandler
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('Hyper' === getenv('TERM_PROGRAM')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (DIRECTORY_SEPARATOR === '\\') {
|
if (DIRECTORY_SEPARATOR === '\\') {
|
||||||
return (function_exists('sapi_windows_vt100_support')
|
return (function_exists('sapi_windows_vt100_support')
|
||||||
&& sapi_windows_vt100_support(STDOUT))
|
&& sapi_windows_vt100_support(STDOUT))
|
||||||
|| false !== getenv('ANSICON')
|
|| false !== getenv('ANSICON')
|
||||||
|| 'ON' === getenv('ConEmuANSI')
|
|| 'ON' === getenv('ConEmuANSI')
|
||||||
|| 'xterm' === getenv('TERM')
|
|| 'xterm' === getenv('TERM');
|
||||||
|| 'Hyper' === getenv('TERM_PROGRAM');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (function_exists('stream_isatty')) {
|
if (function_exists('stream_isatty')) {
|
||||||
|
@ -160,11 +160,11 @@
|
|||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sf-toolbar-block .sf-toolbar-info-piece a {
|
div.sf-toolbar .sf-toolbar-block .sf-toolbar-info-piece a {
|
||||||
color: #99CDD8;
|
color: #99CDD8;
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
.sf-toolbar-block .sf-toolbar-info-piece a:hover {
|
div.sf-toolbar .sf-toolbar-block a:hover {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,13 +93,16 @@ class StreamOutput extends Output
|
|||||||
*/
|
*/
|
||||||
protected function hasColorSupport()
|
protected function hasColorSupport()
|
||||||
{
|
{
|
||||||
|
if ('Hyper' === getenv('TERM_PROGRAM')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (DIRECTORY_SEPARATOR === '\\') {
|
if (DIRECTORY_SEPARATOR === '\\') {
|
||||||
return (function_exists('sapi_windows_vt100_support')
|
return (function_exists('sapi_windows_vt100_support')
|
||||||
&& @sapi_windows_vt100_support($this->stream))
|
&& @sapi_windows_vt100_support($this->stream))
|
||||||
|| false !== getenv('ANSICON')
|
|| false !== getenv('ANSICON')
|
||||||
|| 'ON' === getenv('ConEmuANSI')
|
|| 'ON' === getenv('ConEmuANSI')
|
||||||
|| 'xterm' === getenv('TERM')
|
|| 'xterm' === getenv('TERM');
|
||||||
|| 'Hyper' === getenv('TERM_PROGRAM');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (function_exists('stream_isatty')) {
|
if (function_exists('stream_isatty')) {
|
||||||
|
@ -269,7 +269,7 @@ class SymfonyStyle extends OutputStyle
|
|||||||
{
|
{
|
||||||
$progressBar = parent::createProgressBar($max);
|
$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->setEmptyBarCharacter('░'); // light shade character \u2591
|
||||||
$progressBar->setProgressCharacter('');
|
$progressBar->setProgressCharacter('');
|
||||||
$progressBar->setBarCharacter('▓'); // dark shade character \u2593
|
$progressBar->setBarCharacter('▓'); // dark shade character \u2593
|
||||||
|
@ -117,9 +117,11 @@ class ResolveInstanceofConditionalsPass implements CompilerPassInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$definition->setBindings($bindings);
|
||||||
|
|
||||||
// reset fields with "merge" behavior
|
// reset fields with "merge" behavior
|
||||||
$abstract
|
$abstract
|
||||||
->setBindings($bindings)
|
->setBindings(array())
|
||||||
->setArguments(array())
|
->setArguments(array())
|
||||||
->setMethodCalls(array())
|
->setMethodCalls(array())
|
||||||
->setDecoratedService(null)
|
->setDecoratedService(null)
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
namespace Symfony\Component\DependencyInjection\Tests\Compiler;
|
namespace Symfony\Component\DependencyInjection\Tests\Compiler;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use Symfony\Component\DependencyInjection\Argument\BoundArgument;
|
||||||
use Symfony\Component\DependencyInjection\ChildDefinition;
|
use Symfony\Component\DependencyInjection\ChildDefinition;
|
||||||
use Symfony\Component\DependencyInjection\Compiler\ResolveInstanceofConditionalsPass;
|
use Symfony\Component\DependencyInjection\Compiler\ResolveInstanceofConditionalsPass;
|
||||||
use Symfony\Component\DependencyInjection\Compiler\ResolveChildDefinitionsPass;
|
use Symfony\Component\DependencyInjection\Compiler\ResolveChildDefinitionsPass;
|
||||||
@ -250,4 +251,18 @@ class ResolveInstanceofConditionalsPassTest extends TestCase
|
|||||||
$this->assertEmpty($abstract->getTags());
|
$this->assertEmpty($abstract->getTags());
|
||||||
$this->assertTrue($abstract->isAbstract());
|
$this->assertTrue($abstract->isAbstract());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testBindings()
|
||||||
|
{
|
||||||
|
$container = new ContainerBuilder();
|
||||||
|
$def = $container->register('foo', self::class)->setBindings(array('$toto' => 123));
|
||||||
|
$def->setInstanceofConditionals(array(parent::class => new ChildDefinition('')));
|
||||||
|
|
||||||
|
(new ResolveInstanceofConditionalsPass())->process($container);
|
||||||
|
|
||||||
|
$bindings = $container->getDefinition('foo')->getBindings();
|
||||||
|
$this->assertSame(array('$toto'), array_keys($bindings));
|
||||||
|
$this->assertInstanceOf(BoundArgument::class, $bindings['$toto']);
|
||||||
|
$this->assertSame(123, $bindings['$toto']->getValues()[0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ class ChoiceFormField extends FormField
|
|||||||
/**
|
/**
|
||||||
* Sets the value of the field.
|
* 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)
|
public function select($value)
|
||||||
{
|
{
|
||||||
|
@ -124,6 +124,19 @@ class FlashBagTest extends TestCase
|
|||||||
$this->assertEquals(array('notice'), $this->bag->keys());
|
$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()
|
public function testPeekAll()
|
||||||
{
|
{
|
||||||
$this->bag->set('notice', 'Foo');
|
$this->bag->set('notice', 'Foo');
|
||||||
|
@ -541,13 +541,16 @@ class CliDumper extends AbstractDumper
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('Hyper' === getenv('TERM_PROGRAM')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (DIRECTORY_SEPARATOR === '\\') {
|
if (DIRECTORY_SEPARATOR === '\\') {
|
||||||
return (function_exists('sapi_windows_vt100_support')
|
return (function_exists('sapi_windows_vt100_support')
|
||||||
&& @sapi_windows_vt100_support($stream))
|
&& @sapi_windows_vt100_support($stream))
|
||||||
|| false !== getenv('ANSICON')
|
|| false !== getenv('ANSICON')
|
||||||
|| 'ON' === getenv('ConEmuANSI')
|
|| 'ON' === getenv('ConEmuANSI')
|
||||||
|| 'xterm' === getenv('TERM')
|
|| 'xterm' === getenv('TERM');
|
||||||
|| 'Hyper' === getenv('TERM_PROGRAM');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (function_exists('stream_isatty')) {
|
if (function_exists('stream_isatty')) {
|
||||||
|
Reference in New Issue
Block a user