License   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 33
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setSetting() 0 5 1
A validLicense() 0 4 1
1
<?php
2
/**
3
 * Jaeger
4
 *
5
 * @copyright	Copyright (c) 2015-2016, mithra62
6
 * @link		http://jaeger-app.com
7
 * @version		1.0
8
 * @filesource 	./License.php
9
 */
10
namespace JaegerApp;
11
12
/**
13
 * Jaeger - Licensing Object
14
 *
15
 * Contains the methods for validating the host system
16
 *
17
 * @package License
18
 * @author Eric Lamb <[email protected]>
19
 */
20
class License
21
{
22
23
    /**
24
     * The Setting object
25
     * 
26
     * @var \JaegerApp\Settings
27
     */
28
    protected $setting = null;
29
30
    /**
31
     * Sets the Setting object
32
     * 
33
     * @param \JaegerApp\Settings $settings            
34
     * @return \JaegerApp\License
35
     */
36
    public function setSetting(\JaegerApp\Settings $settings)
37
    {
38
        $this->setting = $settings;
39
        return $this;
40
    }
41
42
    /**
43
     * Validates a license number is valid
44
     * 
45
     * @param string $license            
46
     * @return number
47
     */
48
    public function validLicense($license)
49
    {
50
        return preg_match("/^([a-z0-9]{8})-([a-z0-9]{4})-([a-z0-9]{4})-([a-z0-9]{4})-([a-z0-9]{12})$/", $license);
51
    }
52
}