Completed
Pull Request — master (#219)
by De Cramer
03:20
created

UpdaterWidgetFactory::createContent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 2
cp 0
cc 1
eloc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace eXpansion\Bundle\WidgetBestCheckpoints\Plugins\Gui;
4
5
use eXpansion\Framework\Core\Plugins\Gui\ScriptVariableUpdateFactory;
6
use FML\Script\Builder;
7
8
class UpdaterWidgetFactory extends ScriptVariableUpdateFactory
9
{
10
    /**
11
     * Update with new local record.
12
     *
13
     * @param array $checkpoints
14
     */
15
    public function setLocalRecord($checkpoints)
16
    {
17
        if (count($checkpoints) > 0) {
18
            $this->updateValue('LocalRecordCheckpoints', Builder::getArray($checkpoints, true));
19
        } else {
20
            $this->updateValue('LocalRecordCheckpoints', "Integer[Integer]");
21
        }
22
    }
23
}
24