Passed
Push — 1.0.x ( 8353d5...3a2c37 )
by Julien
21:28
created

MaximumAction::maxAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
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\AbstractModel;
18
use Zemit\Mvc\Controller\Traits\Abstracts\AbstractQuery;
19
use Zemit\Mvc\Controller\Traits\Abstracts\AbstractRestResponse;
20
21
trait MaximumAction
22
{
23
    use AbstractInjectable;
24
    use AbstractQuery;
25
    use AbstractRestResponse;
26
    
27
    /**
28
     * Maximum value of a column
29
     * Alias for maximumAction
30
     * @link maximumAction()
31
     * @throws Exception
32
     */
33
    public function maxAction(): ResponseInterface
34
    {
35
        return $this->maximumAction();
36
    }
37
    
38
    /**
39
     * Maximum value of a column
40
     * @throws Exception
41
     */
42
    public function maximumAction(): ResponseInterface
43
    {
44
        $this->view->setVar('maximum', $this->maximum());
45
        return $this->setRestResponse(true);
46
    }
47
}
48