Completed
Push — develop ( 828b3f...60c2a6 )
by
unknown
14:57 queued 07:47
created

CaptchaOptions   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 98
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setMode() 0 5 1
A getMode() 0 4 1
A setReCaptcha() 0 5 1
A getReCaptcha() 0 4 1
A setImage() 0 5 1
A getImage() 0 4 1
1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @copyright (c) 2013-2015 Cross Solution (http://cross-solution.de)
7
 * @license   MIT
8
 * @author    [email protected]
9
 */
10
11
namespace Auth\Options;
12
13
use Zend\Stdlib\AbstractOptions;
14
15
/**
16
 * Class ModuleOptions
17
 *
18
 * defines AbstractOptions of the Auth Module
19
 */
20
class CaptchaOptions extends AbstractOptions
21
{
22
23
    const RE_CAPTCHA = 'reCaptcha';
24
    const IMAGE = 'image';
25
26
    /**
27
     * enable captcha feature. Possible values:
28
     * - none: captcha feature is disabled
29
     * - reCaptcha: Google reCaptcha service is used.
30
     * - image: local images are created
31
     *
32
     * @var string
33
     */
34
    protected $mode = 'none';
35
36
    /**
37
     * you have to create your private/public key.
38
     * See https://www.google.com/recaptcha/admin#list
39
     *
40
     * @var array
41
     */
42
    protected $reCaptcha = [
43
        'public_key' => 'Your Recapture Public Key',      // "site_key"
44
        'private_key' => 'Your Recapture Private Key',    // "secret_key"
45
        'ssl' => true,                                    // include google api via http(s)
46
        ];
47
48
    /**
49
     * image mode creates local images by using the php gd extension
50
     *
51
     * @var array
52
     */
53
    protected $image = [
54
        'expiration' => '300',
55
        'wordlen' => '7',
56
        'font' => 'data/fonts/arial.ttf',
57
        'fontSize' => '20',
58
        'imgDir' => 'public/captcha',
59
        'imgUrl' => '/captcha'
60
        ];
61
62
    /**
63
     * @param $mode
64
     * @return $this
65
     */
66
    public function setMode($mode)
67
    {
68
        $this->mode = $mode;
69
        return $this;
70
    }
71
72
    /**
73
     * @return bool
0 ignored issues
show
Documentation introduced by
Should the return type not be string?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
74
     */
75
    public function getMode()
76
    {
77
        return $this->mode;
78
    }
79
80
    /**
81
     * @param $reCaptcha
82
     * @return $this
83
     */
84
    public function setReCaptcha($reCaptcha)
85
    {
86
        $this->reCaptcha = $reCaptcha;
87
        return $this;
88
    }
89
90
    /**
91
     * @return array
92
     */
93
    public function getReCaptcha()
94
    {
95
        return $this->reCaptcha;
96
    }
97
98
    /**
99
     * @param $image
100
     * @return $this
101
     */
102
    public function setImage($image)
103
    {
104
        $this->image = $image;
105
        return $this;
106
    }
107
108
    /**
109
     * @return array
110
     */
111
    public function getImage()
112
    {
113
        return $this->image;
114
    }
115
116
117
}
118