<?php

namespace HelpGent\App\Providers;

defined( 'ABSPATH' ) || exit;

use HelpGent\App\Repositories\QuizRepository;
use HelpGent\WpMVC\Contracts\Provider;

class QuizServiceProvider implements Provider {
    public function boot() {
        add_action( 'helpgent_after_response_created', [ $this, 'after_response_created' ], 20, 2 );
    }

    public function after_response_created( int $response_id, array $data ): void {
        /**
         * @var QuizRepository $quiz_repository
         */
        $quiz_repository = helpgent_singleton( QuizRepository::class );
        $quiz_repository->after_response_created( $response_id, $data );
    }
}
