Passed
Branch master (fbf0a6)
by Volodymyr
04:04
created

ScoreThreshold   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 30
dl 0
loc 66
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 12 1
A toOptionArray() 0 38 1
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\Option\ArrayInterface;
13
14
/**
15
 * Class ScoreThreshold
16
 */
17
class ScoreThreshold implements ArrayInterface
0 ignored issues
show
Deprecated Code introduced by
The interface Magento\Framework\Option\ArrayInterface has been deprecated: 102.0.1 please use \Magento\Framework\Data\OptionSourceInterface instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

17
class ScoreThreshold implements /** @scrutinizer ignore-deprecated */ ArrayInterface

This interface has been deprecated. The supplier of the interface has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the interface will be removed and what other interface to use instead.

Loading history...
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