License   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A validate() 0 5 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 	./Validate/Rules/License.php
9
 */
10
namespace JaegerApp\Validate\Rules;
11
12
use JaegerApp\Validate\AbstractRule;
13
use JaegerApp\License as m62License;
14
if (! class_exists('\\mithra62\\Validate\\Rules\\License')) {
15
16
    /**
17
     * mithra62 - License Key Rule
18
     *
19
     * Checks an input to see if it's a valid license key
20
     *
21
     * @package Validate\Rules
22
     * @author Eric Lamb <[email protected]>
23
     */
24
    class License extends AbstractRule
25
    {
26
27
        /**
28
         * The Rule shortname
29
         * 
30
         * @var unknown
31
         */
32
        protected $name = 'license_key';
33
34
        /**
35
         * the error template
36
         * 
37
         * @var string
38
         */
39
        protected $error_message = '{field} isn\'t a valid license key';
40
41
        /**
42
         * (non-PHPdoc)
43
         * 
44
         * @see \mithra62\Validate\RuleInterface::validate()
45
         * @ignore
46
         *
47
         */
48
        public function validate($field, $input, array $params = array())
49
        {
50
            $license = new m62License();
51
            return $license->validLicense($input);
52
        }
53
    }
54
}