diff --git a/installer/Application/GRPC.php b/installer/Application/GRPC.php index 58fa75f..f05a8c1 100644 --- a/installer/Application/GRPC.php +++ b/installer/Application/GRPC.php @@ -10,7 +10,7 @@ use Installer\Generator\GeneratorInterface; use Installer\Package\ExtGRPC; use Installer\Package\ExtMbString; -use Installer\Package\Generator\RoadRunnerBridge\GRPC as RoadRunnerGRPC; +use Installer\Package\Generator\RoadRunnerBridge\GRPCBootloader; use Installer\Package\GRPC as PackageGRPC; use Installer\Package\Package; use Installer\Package\RoadRunnerBridge; @@ -51,7 +51,7 @@ public function __construct( array $questions = [], array $generators = [ new GRPCApplicationBootloaders(), - new RoadRunnerGRPC(), + new GRPCBootloader(), new ViewRenderer(), ], array $resources = [ diff --git a/installer/Package/Generator/RoadRunnerBridge/GRPC.php b/installer/Package/Generator/RoadRunnerBridge/GRPCBootloader.php similarity index 67% rename from installer/Package/Generator/RoadRunnerBridge/GRPC.php rename to installer/Package/Generator/RoadRunnerBridge/GRPCBootloader.php index bd7dd6d..b50310f 100644 --- a/installer/Package/Generator/RoadRunnerBridge/GRPC.php +++ b/installer/Package/Generator/RoadRunnerBridge/GRPCBootloader.php @@ -7,13 +7,13 @@ use Installer\Generator\Context; use Installer\Generator\GeneratorInterface; use Spiral\RoadRunnerBridge\Bootloader\CacheBootloader; -use Spiral\RoadRunnerBridge\Bootloader\GRPCBootloader; +use Spiral\RoadRunnerBridge\Bootloader\GRPCBootloader as Bootloader; -final class GRPC implements GeneratorInterface +final class GRPCBootloader implements GeneratorInterface { public function process(Context $context): void { - $context->kernel->load->append(GRPCBootloader::class, CacheBootloader::class); + $context->kernel->load->append(Bootloader::class, CacheBootloader::class); $context->application->useRoadRunnerPlugin('grpc'); diff --git a/installer/Question/RoadRunnerGRPC.php b/installer/Question/RoadRunnerGRPC.php index 925c05c..a8b9594 100644 --- a/installer/Question/RoadRunnerGRPC.php +++ b/installer/Question/RoadRunnerGRPC.php @@ -4,9 +4,9 @@ namespace Installer\Question; -use Installer\Package\Generator\RoadRunnerBridge\GRPC; -use Installer\Package\Package; +use Installer\Package\Generator\RoadRunnerBridge\GRPCBootloader; use Installer\Package\Packages; +use Installer\Question\Option\BooleanOption; use Installer\Question\Option\Option; final class RoadRunnerGRPC extends AbstractQuestion @@ -18,16 +18,19 @@ public function __construct( string $question = 'Do you need the RoadRunner gRPC?', bool $required = false, array $options = [ - new Option(name: 'Yes', packages: [ - new Package( - package: Packages::RoadRunnerBridge, - generators: [ - new GRPC(), - ] - ), - ]), + new BooleanOption( + name: 'Yes', + generators: [ + new GRPCBootloader(), + ] + ), + ], + array $conditions = [ + 'require' => [ + Packages::RoadRunnerBridge, + ], ] ) { - parent::__construct($question, $required, $options); + parent::__construct($question, $required, $options, $conditions); } } diff --git a/installer/Question/RoadRunnerMetrics.php b/installer/Question/RoadRunnerMetrics.php index cc9c1b1..b02409d 100644 --- a/installer/Question/RoadRunnerMetrics.php +++ b/installer/Question/RoadRunnerMetrics.php @@ -5,6 +5,7 @@ namespace Installer\Question; use Installer\Package\Generator\RoadRunnerBridge\MetricsBootloader; +use Installer\Package\Packages; use Installer\Question\Option\BooleanOption; use Installer\Question\Option\OptionInterface; @@ -23,8 +24,13 @@ public function __construct( new MetricsBootloader(), ] ), + ], + array $conditions = [ + 'require' => [ + Packages::RoadRunnerBridge, + ], ] ) { - parent::__construct($question, $required, $options); + parent::__construct($question, $required, $options, $conditions); } } diff --git a/installer/config.php b/installer/config.php index 6e4e935..76e1f92 100644 --- a/installer/config.php +++ b/installer/config.php @@ -28,6 +28,7 @@ new Question\CycleBridge(), new Question\Serializer(), new Question\Mailer(), + new Question\RoadRunnerBridge(), new Question\RoadRunnerMetrics(), ] ),