Completed
Push — master ( 49679a...617b2a )
by Sudar
02:03
created

License   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 36
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A is_valid() 0 4 1
A get_license_key() 0 3 1
A get_download_url() 0 9 2
1
<?php namespace EmailLog\License;
2
3
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
4
5
/**
6
 * EmailLog License.
7
 *
8
 * @since 2.0.0
9
 */
10
class License extends BaseLicense {
11
12
	/**
13
	 * Is the license activated and valid?
14
	 *
15
	 * @return bool True if license is active, False otherwise.
16
	 */
17
	public function is_valid() {
18
		// TODO: Implement is_valid() method.
19
		return false;
20
	}
21
22
	/**
23
	 * Get the license key.
24
	 *
25
	 * @return string License Key.
26
	 */
27
	public function get_license_key() {
28
		return $this->license_key;
29
	}
30
31
	/**
32
	 * Get the download url for the add-on.
33
	 *
34
	 * @return string Download url.
35
	 */
36
	public function get_download_url() {
37
		try {
38
			$response = $this->get_version();
39
		} catch ( \Exception $e ) {
40
			return '';
41
		}
42
43
		return $response->download_link;
44
	}
45
}
46