Code Duplication    Length = 13-13 lines in 5 locations

src/wordlift/vocabulary/api/class-background-analysis-endpoint.php 4 locations

@@ 43-55 (lines=13) @@
40
			} );
41
	}
42
43
	private function register_start_route() {
44
		register_rest_route(
45
			Api_Config::REST_NAMESPACE,
46
			'/background_analysis/start',
47
			array(
48
				'methods'             => WP_REST_Server::CREATABLE,
49
				'callback'            => array( $this, 'start' ),
50
				'permission_callback' => function () {
51
					return current_user_can( 'manage_options' );
52
				},
53
			)
54
		);
55
	}
56
57
	private function register_stop_route() {
58
		register_rest_route(
@@ 57-69 (lines=13) @@
54
		);
55
	}
56
57
	private function register_stop_route() {
58
		register_rest_route(
59
			Api_Config::REST_NAMESPACE,
60
			'/background_analysis/stop',
61
			array(
62
				'methods'             => WP_REST_Server::CREATABLE,
63
				'callback'            => array( $this, 'stop' ),
64
				'permission_callback' => function () {
65
					return current_user_can( 'manage_options' );
66
				},
67
			)
68
		);
69
	}
70
71
	private function register_stats_route() {
72
		register_rest_route(
@@ 71-83 (lines=13) @@
68
		);
69
	}
70
71
	private function register_stats_route() {
72
		register_rest_route(
73
			Api_Config::REST_NAMESPACE,
74
			'/background_analysis/stats',
75
			array(
76
				'methods'             => WP_REST_Server::CREATABLE,
77
				'callback'            => array( $this, 'get_stats' ),
78
				'permission_callback' => function () {
79
					return current_user_can( 'manage_options' );
80
				},
81
			)
82
		);
83
	}
84
85
86
	private function register_restart_route() {
@@ 86-98 (lines=13) @@
83
	}
84
85
86
	private function register_restart_route() {
87
		register_rest_route(
88
			Api_Config::REST_NAMESPACE,
89
			'/background_analysis/restart',
90
			array(
91
				'methods'             => WP_REST_Server::CREATABLE,
92
				'callback'            => array( $this, 'restart' ),
93
				'permission_callback' => function () {
94
					return current_user_can( 'manage_options' );
95
				},
96
			)
97
		);
98
	}
99
100
101
	public function get_stats() {

src/wordlift/vocabulary/api/class-reconcile-progress-endpoint.php 1 location

@@ 77-89 (lines=13) @@
74
	}
75
76
77
	private function register_progress_route() {
78
		register_rest_route(
79
			Api_Config::REST_NAMESPACE,
80
			'/reconcile_progress/progress',
81
			array(
82
				'methods'             => \WP_REST_Server::CREATABLE,
83
				'callback'            => array( $this, 'progress' ),
84
				'permission_callback' => function () {
85
					return current_user_can( 'manage_options' );
86
				},
87
			)
88
		);
89
	}
90
91
92
}