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

SupportedAddonsApiController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 25
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 8 1
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