Skip to content
This repository was archived by the owner on Jan 21, 2020. It is now read-only.

Commit b0f86a3

Browse files
committed
Merge branch 'hotfix/244'
Close #244
2 parents b21a14a + c5480b5 commit b0f86a3

File tree

5 files changed

+24
-8
lines changed

5 files changed

+24
-8
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ All notable changes to this project will be documented in this file, in reverse
2222

2323
### Fixed
2424

25-
- Nothing.
25+
- [#244](https://github.com/zendframework/zend-expressive-skeleton/pull/244)
26+
fixes an issue with installer prompts when symfony/console v4 is installed
27+
globally.
2628

2729
## 3.0.1 - 2018-03-19
2830

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,10 @@
9494
"expressive": "expressive --ansi",
9595
"check": [
9696
"@cs-check",
97-
"@test"
97+
"@test",
98+
"@analyze"
9899
],
100+
"analyze": "phpstan analyze -l max -c ./phpstan.installer.neon ./src ./config",
99101
"clear-config-cache": "php bin/clear-config-cache.php",
100102
"cs-check": "phpcs",
101103
"cs-fix": "phpcbf",

src/ExpressiveInstaller/OptionalPackages.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public function requestInstallType() : string
251251
];
252252

253253
while (true) {
254-
$answer = $this->io->ask($query, '2');
254+
$answer = $this->io->ask(implode($query), '2');
255255

256256
switch (true) {
257257
case ($answer === '1'):
@@ -621,7 +621,7 @@ private function askQuestion(array $question, $defaultOption)
621621

622622
while (true) {
623623
// Ask for user input
624-
$answer = $this->io->ask($ask, (string) $defaultOption);
624+
$answer = $this->io->ask(implode($ask), (string) $defaultOption);
625625

626626
// Handle none of the options
627627
if ($answer === 'n' && $question['required'] !== true) {

test/ExpressiveInstallerTest/PromptForOptionalPackagesTest.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,16 @@ public function testPromptForOptionalPackage(
9090

9191
public static function assertPromptText($expected, $argument)
9292
{
93-
$argument = is_array($argument) ? array_shift($argument) : $argument;
94-
$message = sprintf('Expected prompt not received: "%s"', $expected);
95-
self::assertThat(false !== strpos($argument, $expected), self::isTrue(), $message);
93+
self::assertInternalType(
94+
'string',
95+
$argument,
96+
'Questions must be a string since symfony/console:4.0'
97+
);
98+
99+
self::assertThat(
100+
false !== strpos($argument, $expected),
101+
self::isTrue(),
102+
sprintf('Expected prompt not received: "%s"', $expected)
103+
);
96104
}
97105
}

test/ExpressiveInstallerTest/RequestInstallTypeTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ public function testWillContinueToPromptUntilValidAnswerPresented()
7878

7979
public static function assertQueryPrompt($value)
8080
{
81-
$value = is_array($value) ? array_shift($value) : $value;
81+
self::assertInternalType(
82+
'string',
83+
$value,
84+
'Questions must be a string since symfony/console:4.0'
85+
);
8286

8387
self::assertThat(
8488
false !== strpos($value, 'What type of installation would you like?'),

0 commit comments

Comments
 (0)