Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit166ca8d

Browse files
bug#43376 [Runtime] Fix class validation of composer "extra.runtime.class" (piku235)
This PR was merged into the 5.3 branch.Discussion----------[Runtime] Fix class validation of composer "extra.runtime.class"| Q | A| ------------- | ---| Branch? | 5.3| Bug fix? | yes| New feature? | no| Deprecations? | no| License | MITThis PR fixes a bug of validating a runtime class from the composer param `extra.runtime.class`. When provided, it always fails. Taking as an example the `Runtime\Swoole\Runtime` of the `runtime/swoole` package, when executing the `composer dump-autoload`, it ends with the following exception, even though the `runtime/swoole` package was installed.``` [InvalidArgumentException] Class "Runtime\Swoole\Runtime" listed under "extra.runtime.class" in your composer.json file not found.```When a composer plugin is executed, the composer autoloader for the project is not registered, thereby any reference to a class from installed packages won't work.The fix drops this check to avoid it. I don't think it's worth checking here if a runtime class is valid or not. For instance, anything that comes from the `$_SERVER['APP_RUNTIME']` is accepted, nothing is validated.Commits-------13f69f2 [Runtime] Drop class validation of composer "extra.runtime.class"
2 parentse556cec +13f69f2 commit166ca8d

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

‎src/Symfony/Component/Runtime/Internal/ComposerPlugin.php‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
useComposer\Plugin\PluginInterface;
1919
useComposer\Script\ScriptEvents;
2020
useSymfony\Component\Filesystem\Filesystem;
21-
useSymfony\Component\Runtime\RuntimeInterface;
2221
useSymfony\Component\Runtime\SymfonyRuntime;
2322

2423
/**
@@ -98,10 +97,6 @@ public function updateAutoloadFile(): void
9897

9998
$runtimeClass =$extra['class'] ?? SymfonyRuntime::class;
10099

101-
if (SymfonyRuntime::class !==$runtimeClass && !is_subclass_of($runtimeClass, RuntimeInterface::class)) {
102-
thrownew \InvalidArgumentException(sprintf('Class "%s" listed under "extra.runtime.class" in your composer.json file'.(class_exists($runtimeClass) ?'should implement "%s".' :'not found.'),$runtimeClass, RuntimeInterface::class));
103-
}
104-
105100
unset($extra['class'],$extra['autoload_template']);
106101

107102
$code =strtr(file_get_contents($autoloadTemplate), [

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp