Completed
Push — master ( 7ad254...81439b )
by Robbie
10s
created

SupportedAddonsApiController::index()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
class SupportedAddonsApiController extends ApiController
4
{
5
    private static $allowed_actions = [
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
6
        'index',
7
    ];
8
9
    /**
10
     * Set the default cache lifetime in seconds. Only used outside of "dev" environments.
11
     *
12
     * Set to 1 week
13
     *
14
     * @config
15
     * @var int
16
     */
17
    private static $cache_age = 604800;
18
19
    public function index()
20
    {
21
        $supportedAddons = Addon::get()->filter('Supported', true)->column('Name');
22
23
        $result = ['success' => true, 'addons' => $supportedAddons];
24
25
        return $this->formatResponse($result);
26
    }
27
}
28