ScoreThreshold::toOptionArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 38
Code Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 19
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 38
rs 9.6333
1
<?php
2
/**
3
 * Copyright (c) 2019. Volodymyr Hryvinskyi.  All rights reserved.
4
 * @author: <mailto:[email protected]>
5
 * @github: <https://github.com/hryvinskyi>
6
 */
7
8
declare(strict_types=1);
9
10
namespace Hryvinskyi\InvisibleCaptcha\Model\Config\Source;
11
12
use Magento\Framework\Data\OptionSourceInterface;
13
14
/**
15
 * Class ScoreThreshold
16
 */
17
class ScoreThreshold implements OptionSourceInterface
18
{
19
    /**
20
     * Options getter
21
     *
22
     * @return array
23
     */
24
    public function toOptionArray()
25
    {
26
        return [
27
            [
28
                'value' => 0.1,
29
                'label' => 0.1
30
            ],
31
            [
32
                'value' => 0.2,
33
                'label' => 0.2
34
            ],
35
            [
36
                'value' => 0.3,
37
                'label' => 0.3
38
            ],
39
            [
40
                'value' => 0.4,
41
                'label' => 0.4
42
            ],
43
            [
44
                'value' => 0.5,
45
                'label' => 0.5
46
            ],
47
            [
48
                'value' => 0.6,
49
                'label' => 0.6
50
            ],
51
            [
52
                'value' => 0.7,
53
                'label' => 0.7
54
            ],
55
            [
56
                'value' => 0.8,
57
                'label' => 0.8
58
            ],
59
            [
60
                'value' => 0.9,
61
                'label' => 0.9
62
            ]
63
        ];
64
    }
65
66
    /**
67
     * Get options in "key-value" format
68
     *
69
     * @return array
70
     */
71
    public function toArray()
72
    {
73
        return [
74
            '0.1' => 0.1,
75
            '0.2' => 0.2,
76
            '0.3' => 0.3,
77
            '0.4' => 0.4,
78
            '0.5' => 0.5,
79
            '0.6' => 0.6,
80
            '0.7' => 0.7,
81
            '0.8' => 0.8,
82
            '0.9' => 0.9,
83
        ];
84
    }
85
}
86