UpdateAddonsTask   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A run() 0 7 2
1
<?php
2
/**
3
 * Runs the add-on updater.
4
 *
5
 * @package mysite
6
 */
7
class UpdateAddonsTask extends BuildTask
8
{
9
    /**
10
     * {@inheritDoc}
11
     * @var string
12
     */
13
    protected $title = 'Update Add-ons';
14
15
    /**
16
     * {@inheritDoc}
17
     * @var string
18
     */
19
    protected $description = 'Updates add-ons from Packagist';
20
21
    /**
22
     * @var AddonUpdater
23
     */
24
    private $updater;
25
26
    /**
27
     * @param AddonUpdater $updater
28
     */
29
    public function __construct(AddonUpdater $updater)
30
    {
31
        $this->updater = $updater;
32
    }
33
34
    /**
35
     * {@inheritDoc}
36
     * @param SS_HTTPRequest $request
37
     */
38
    public function run($request)
39
    {
40
        $this->updater->update(
41
            (bool)$request->getVar('clear'),
42
            $request->getVar('addons') ? explode(',', $request->getVar('addons')) : null
43
        );
44
    }
45
}
46