Skip to content

Commit a76821c

Browse files
Merge branch '3.0'
* 3.0: (105 commits) [Console] remove readline support bumped Symfony version to 3.0.3 updated VERSION for 3.0.2 updated CHANGELOG for 3.0.2 [Routing] added a suggestion to add the HttpFoundation component. [FrameworkBundle] fix assets and templating tests [ClassLoader] fix ApcClassLoader tests on HHVM [travis] Add some comments changed operator from and to && [DependencyInjection] Remove unused parameter [Process] Fix transient tests for incremental outputs [Console] Add missing `@require` annotation in test Fix merge [appveyor] Fix failure reporting [#17634] move DebugBundle license file Limit Ldap component version for the 3.0 branch backport GlobTest from 2.7 branch Move licenses according to new best practices [FrameworkBundle] Remove unused code in test [2.3] Fixed an undefined variable in Glob::toRegex ... Conflicts: .travis.yml composer.json src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets.php src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/assets.xml src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/assets.yml src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig src/Symfony/Component/Console/CHANGELOG.md src/Symfony/Component/HttpKernel/Kernel.php src/Symfony/Component/PropertyInfo/Tests/PropertyInfoExtractorTest.php src/Symfony/Component/Yaml/Tests/ParserTest.php
2 parents 00bedeb + 1de16cd commit a76821c

File tree

4 files changed

+14
-25
lines changed

4 files changed

+14
-25
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ CHANGELOG
66

77
* added truncate method to FormatterHelper
88

9+
2.8.3
10+
-----
11+
12+
* remove readline support from the question helper as it caused issues
13+
914
2.8.0
1015
-----
1116

Helper/QuestionHelper.php

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ private function doAsk(OutputInterface $output, Question $question)
130130
}
131131

132132
if (false === $ret) {
133-
$ret = $this->readFromInput($inputStream);
133+
$ret = fgets($inputStream, 4096);
134+
if (false === $ret) {
135+
throw new \RuntimeException('Aborted');
136+
}
137+
$ret = trim($ret);
134138
}
135139
} else {
136140
$ret = trim($this->autocomplete($output, $question, $inputStream));
@@ -423,30 +427,6 @@ private function getShell()
423427
return self::$shell;
424428
}
425429

426-
/**
427-
* Reads user input.
428-
*
429-
* @param resource $stream The input stream
430-
*
431-
* @return string User input
432-
*
433-
* @throws RuntimeException
434-
*/
435-
private function readFromInput($stream)
436-
{
437-
if (STDIN === $stream && function_exists('readline')) {
438-
$ret = readline('');
439-
} else {
440-
$ret = fgets($stream, 4096);
441-
}
442-
443-
if (false === $ret) {
444-
throw new RuntimeException('Aborted');
445-
}
446-
447-
return trim($ret);
448-
}
449-
450430
/**
451431
* Returns whether Stty is available or not.
452432
*

Tests/Descriptor/AbstractDescriptorTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ public function getDescribeApplicationTestData()
8383
}
8484

8585
abstract protected function getDescriptor();
86+
8687
abstract protected function getFormat();
8788

8889
private function getDescriptionTestData(array $objects)

Tests/Helper/QuestionHelperTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,9 @@ public function testNoInteraction()
351351
$this->assertEquals('not yet', $dialog->ask($this->createInputInterfaceMock(false), $this->createOutputInterface(), $question));
352352
}
353353

354+
/**
355+
* @requires function mb_strwidth
356+
*/
354357
public function testChoiceOutputFormattingQuestionForUtf8Keys()
355358
{
356359
$question = 'Lorem ipsum?';

0 commit comments

Comments
 (0)