Test Failed
Push — master ( 507036...762659 )
by Julien
21:33
created

SumAction   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 16
ccs 0
cts 3
cp 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A sumAction() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of the Zemit Framework.
5
 *
6
 * (c) Zemit Team <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE.txt
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Zemit\Mvc\Controller\Traits\Actions\Rest;
13
14
use Exception;
15
use Phalcon\Http\ResponseInterface;
16
use Zemit\Mvc\Controller\Traits\Abstracts\AbstractInjectable;
17
use Zemit\Mvc\Controller\Traits\Abstracts\AbstractQuery;
18
use Zemit\Mvc\Controller\Traits\Abstracts\AbstractRestResponse;
19
20
trait SumAction
21
{
22
    use AbstractInjectable;
23
    use AbstractQuery;
24
    use AbstractRestResponse;
25
    
26
    /**
27
     * Calculates the sum of a column.
28
     *
29
     * @return ResponseInterface The REST response with a status of true.
30
     * @throws Exception
31
     */
32
    public function sumAction(): ResponseInterface
33
    {
34
        $this->view->setVar('sum', $this->sum());
35
        return $this->setRestResponse(true);
36
    }
37
}
38