Test Failed
Push — develop ( a95e4d...dfe8c9 )
by Remco
03:31
created

SiteHealthController::setup()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 2
rs 10
1
<?php
2
/**
3
 * Site Health controller
4
 *
5
 * @author    Pronamic <[email protected]>
6
 * @copyright 2005-2019 Pronamic
7
 * @license   GPL-3.0-or-later
8
 * @package   Pronamic\WordPress\Pay\Gateways\Adyen
9
 */
10
11
namespace Pronamic\WordPress\Pay\Gateways\Adyen;
12
13
/**
14
 * Site Health controller
15
 *
16
 * @author  Remco Tolsma
17
 * @version unreleased
18
 * @since   unreleased
19
 */
20
class SiteHealthController {
21
	/**
22
	 * Setup.
23
	 *
24
	 * @return void
25
	 */
26
	public function setup() {
27
		add_action( 'rest_api_init', array( $this, 'rest_api_init' ) );
28
	}
29
30
	/**
31
	 * REST API init.
32
	 *
33
	 * @link https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-custom-endpoints/
34
	 * @link https://developer.wordpress.org/reference/hooks/rest_api_init/
35
	 *
36
	 * @return void
37
	 */
38
	public function rest_api_init() {
39
		register_rest_route(
40
			Integration::REST_ROUTE_NAMESPACE,
41
			'/http-authorization-test',
42
			array(
43
				'methods'             => 'GET',
44
				'callback'            => array( $this, '__return_false' ),
45
				'permission_callback' => array( $this, '__return_false' ),
46
			)
47
		);
48
	}
49
}
50