Skip to content

Commit d296118

Browse files
committed
Fix the dependency isolation scenarios failing on PHP 7.x
The mu-plugins used a `\Stringable|string` union type, which is a parse error on the PHP 7.2 to 7.4 jobs in the matrix, so the scenarios failed with "syntax error, unexpected '|'" rather than exercising anything. Narrowing an untyped parameter to `string` is the same contravariance violation and parses on every version the suite runs, so the scenarios still distinguish a prefixed tree from an unprefixed one: declaring the class against an unprefixed `psr/log` v1 remains a fatal error, and succeeds once the bundled copy is prefixed. Also drop `--format=count` from `wp package list`, which does not offer that format and made the step fail on argument parsing. Refs wp-cli/wp-cli#5920 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RHtjyXkZh8X16sBgmidSQi
1 parent 8d50385 commit d296118

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎features/dependency-isolation.feature‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ Feature: Bundled dependencies do not conflict with the site's own
3131
eval(
3232
'namespace Psr\Log;
3333
interface LoggerInterface {
34-
public function emergency( \Stringable|string $message, array $context = [] ): void;
34+
public function emergency( string $message, array $context = [] ): void;
3535
}'
3636
);
3737
}
3838
);
3939
4040
final class Site_Logger implements \Psr\Log\LoggerInterface {
41-
public function emergency( \Stringable|string $message, array $context = [] ): void {
41+
public function emergency( string $message, array $context = [] ): void {
4242
}
4343
}
4444
"""
@@ -69,14 +69,14 @@ Feature: Bundled dependencies do not conflict with the site's own
6969
eval(
7070
'namespace Symfony\Component\Console\Output;
7171
interface OutputInterface {
72-
public function writeln( \Stringable|string $messages, int $options = 0 ): void;
72+
public function writeln( string $messages, int $options = 0 ): void;
7373
}'
7474
);
7575
}
7676
);
7777
7878
final class Site_Output implements \Symfony\Component\Console\Output\OutputInterface {
79-
public function writeln( \Stringable|string $messages, int $options = 0 ): void {
79+
public function writeln( string $messages, int $options = 0 ): void {
8080
}
8181
}
8282
"""
@@ -93,6 +93,6 @@ Feature: Bundled dependencies do not conflict with the site's own
9393
# strings, which prefixing of static `use` statements does not cover.
9494
Given an empty directory
9595

96-
When I run `wp package list --format=count`
96+
When I run `wp package list`
9797
Then STDERR should be empty
9898
And the return code should be 0

0 commit comments

Comments
 (0)