Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 2
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2/**
3 * Contract for one feature of the Protect dashboard, such as Scan or Monitor.
4 *
5 * @package automattic/jetpack-protect
6 */
7
8namespace Automattic\Jetpack\Protect;
9
10if ( ! defined( 'ABSPATH' ) ) {
11    exit( 0 );
12}
13
14/**
15 * A dashboard section: the state its UI starts from, and the REST routes it reads and writes.
16 *
17 * @since 0.1.0
18 */
19interface Dashboard_Section {
20
21    /**
22     * The key the section's state is printed under, matching the JS section's `key`.
23     *
24     * @return string
25     */
26    public function get_key();
27
28    /**
29     * The state the section's UI renders from on page load.
30     *
31     * @return array
32     */
33    public function get_state();
34
35    /**
36     * Register the section's REST routes. Runs on `rest_api_init`.
37     *
38     * @return void
39     */
40    public function register_routes();
41}