provides, true ); } /** * Register the service in the provider array * * @return void */ public function boot(): void { $this->services = $this->getContainer()->get( 'debug_resolver' )->get_services(); if ( empty( $this->services ) ) { return; } $this->provides[] = 'options_debug'; foreach ( $this->services as $service ) { $this->provides[] = $service['service']; } } /** * Registers items with the container * * @return void */ public function register(): void { $this->container->addShared( 'debug_subscriber', DebugSubscriber::class ); if ( empty( $this->services ) ) { return; } $this->container->add( 'options_debug', Options_Data::class ) ->addArgument( $this->container->get( 'options_api' )->get( 'debug', [] ) ); foreach ( $this->services as $service ) { $this->getContainer()->add( $service['service'], $service['class'] ) ->addArgument( 'options_debug' ) ->addArgument( 'options_api' ); } } }