Completed
Push — master ( daab91...b549ed )
by Derek Stephen
02:54 queued 11s
created

Captcha   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 27
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 5 1
A setCaptchaAdapter() 0 4 1
A getCaptchAdapter() 0 4 1
1
<?php
2
3
namespace Del\Form\Field;
4
5
use Del\Form\Field\Captcha\CaptchaAdapterInterface;
6
use Del\Form\Filter\Adapter\FilterAdapterZf;
7
use Del\Form\Renderer\Field\CaptchaRender;
8
use Zend\Filter\StringTrim;
9
use Zend\Filter\StripTags;
10
11
class Captcha extends Text
12
{
13
    /** @var CaptchaAdapterInterface $captchAdapter */
14
    private $captchaAdapter;
15
16
    public function init(): void
17
    {
18
        parent::init();
19
        $this->setRenderer(new CaptchaRender());
20
    }
21
22
    /**
23
     * @param CaptchaAdapterInterface $captchaAdapter
24
     */
25
    public function setCaptchaAdapter(CaptchaAdapterInterface $captchaAdapter): void
26
    {
27
        $this->captchaAdapter = $captchaAdapter;
28
    }
29
30
    /**
31
     * @return CaptchaAdapterInterface
32
     */
33
    public function getCaptchAdapter(): CaptchaAdapterInterface
34
    {
35
        return $this->captchaAdapter;
36
    }
37
}