Completed
Push — master ( 17e3a2...711227 )
by Andrii
03:12
created

BoxJsonController::actionSave()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 6
ccs 0
cts 4
cp 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
crap 2
1
<?php
2
3
/*
4
 * Box plugin for HiDev
5
 *
6
 * @link      https://github.com/hiqdev/hidev-box
7
 * @package   hidev-box
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hidev\box\controllers;
13
14
use hidev\helpers\Helper;
15
16
/**
17
 * Goal for box.json config file.
18
 */
19
class BoxJsonController extends \hidev\controllers\FileController
20
{
21
    protected $_file = 'box.json';
22
23
    public function actionSave()
24
    {
25
        $this->_items = Helper::uniqueConfig($this->_items);
26
        $this->getFile()->save($this->getItems());
27
        return 0;
28
    }
29
}
30