Test Failed
Push — develop ( 88a604...f54e3f )
by Reüel
02:40
created

Integration::get_settings_class()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\Nocks;
4
5
use Pronamic\WordPress\Pay\Gateways\Common\AbstractIntegration;
6
7
/**
8
 * Title: Nocks integration
9
 * Description:
10
 * Copyright: 2005-2019 Pronamic
11
 * Company: Pronamic
12
 *
13
 * @author  Reüel van der Steege
14
 * @version 2.0.0
15
 * @since   1.0.0
16
 */
17
class Integration extends AbstractIntegration {
18
	public function __construct() {
19
		$this->id            = 'nocks';
20
		$this->name          = 'Nocks - Checkout';
21
		$this->product_url   = 'https://www.nocks.com/';
22
		$this->dashboard_url = 'https://www.nocks.com/';
23
		$this->provider      = 'nocks';
24
25
		// Actions
26
		$function = array( __NAMESPACE__ . '\Listener', 'listen' );
27
28
		if ( ! has_action( 'wp_loaded', $function ) ) {
0 ignored issues
show
Bug introduced by
The function has_action was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

28
		if ( ! /** @scrutinizer ignore-call */ has_action( 'wp_loaded', $function ) ) {
Loading history...
29
			add_action( 'wp_loaded', $function );
0 ignored issues
show
Bug introduced by
The function add_action was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

29
			/** @scrutinizer ignore-call */ 
30
   add_action( 'wp_loaded', $function );
Loading history...
30
		}
31
	}
32
33
	public function get_config_factory_class() {
34
		return __NAMESPACE__ . '\ConfigFactory';
35
	}
36
37
	public function get_settings_class() {
38
		return __NAMESPACE__ . '\Settings';
39
	}
40
41
	/**
42
	 * Get required settings for this integration.
43
	 *
44
	 * @return array
45
	 */
46
	public function get_settings() {
47
		$settings = parent::get_settings();
48
49
		$settings[] = 'nocks';
50
51
		return $settings;
52
	}
53
}
54