Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | 2 | public function set(string $alias, ArrayAccess &$session, string $errorMessage, string $font = '/usr/share/fonts/truetype/freefont/FreeMono.ttf'): AGraphical |
|
18 | { |
||
19 | 2 | $this->font = $font; |
|
20 | |||
21 | 2 | $num1 = mt_rand(0, 9); |
|
22 | 2 | $num2 = mt_rand(0, 9); |
|
23 | 2 | $text = ' ' . $num1 . ' + ' . $num2 . ' ='; |
|
24 | |||
25 | 2 | $this->setEntry($alias, null, $text); |
|
26 | 2 | $this->fillSession($alias, $session, strval($num1 + $num2)); |
|
27 | 2 | $this->setAttribute('id', $this->getKey()); |
|
28 | 2 | parent::addRule(IRules::SATISFIES_CALLBACK, $errorMessage, [$this, 'checkFillCaptcha']); |
|
29 | 2 | return $this; |
|
30 | } |
||
57 |