AddonLicense   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 23
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get_license_key() 0 6 2
A get_option_name() 0 2 1
1
<?php namespace EmailLog\Addon\License;
2
3
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
4
5
/**
6
 * EmailLog License.
7
 *
8
 * @since 2.0.0
9
 */
10
class AddonLicense extends BaseLicense {
11
12
	/**
13
	 * Get License key.
14
	 *
15
	 * @return string|null License key.
16
	 */
17
	public function get_license_key() {
18
		if ( empty( $this->license_data ) ) {
19
			return parent::get_license_key();
20
		}
21
22
		return $this->license_data->license_key;
23
	}
24
25
	/**
26
	 * Option name in which individual license data is stored.
27
	 * This method should be called only after setting the add-on name.
28
	 *
29
	 * @return string Option name.
30
	 */
31
	protected function get_option_name() {
32
		return 'el_license_' . md5( $this->get_addon_name() );
33
	}
34
}
35