GuaranteeTime   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
dl 0
loc 27
rs 10
c 1
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A toOptionArray() 0 10 2
1
<?php
2
3
namespace Payone\Core\Model\Source;
4
5
use Magento\Framework\Option\ArrayInterface;
0 ignored issues
show
Bug introduced by
The type Magento\Framework\Option\ArrayInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
class GuaranteeTime implements ArrayInterface
8
{
9
    /**
10
     * @var int
11
     */
12
    protected $iAllowedDaysMin = 1;
13
14
    /**
15
     * @var int
16
     */
17
    protected $iAllowedDaysMax = 15;
18
19
    /**
20
     * Return allowed guarantee times
21
     *
22
     * @return array
23
     */
24
    public function toOptionArray()
25
    {
26
        $aOptions = [];
27
        for($i = $this->iAllowedDaysMin; $i <= $this->iAllowedDaysMax; $i ++) {
28
            $aOptions[] = [
29
                'value' => $i,
30
                'label' => $i,
31
            ];
32
        }
33
        return $aOptions;
34
    }
35
}
36