src/controller/class-launcher.php
public function run_ajax() {

		$methods = [ 'add_movie_rating' ];

		foreach ( $methods as $method ) {
			add_action( 'wp_ajax_' . $method, [ $this->rating, $method ] );
			add_action( 'wp_ajax_nopriv_' . $method, [ $this->rating, $method ] );
		}
	}
public function run_ajax() {

		$methods = [ 'add_movie_rating' ];

		foreach ( $methods as $method ) {
			add_action( 'wp_ajax_' . $method, [ $this->rating, $method ] );
			add_action( 'wp_ajax_nopriv_' . $method, [ $this->rating, $method ] );
		}
	}
Run ajax when change the rating.