Updater   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 15 3
1
<?php
2
/**
3
 * ownCloud - News
4
 *
5
 * This file is licensed under the Affero General Public License version 3 or
6
 * later. See the COPYING file.
7
 *
8
 * @author    Alessandro Cosentino <[email protected]>
9
 * @author    Bernhard Posselt <[email protected]>
10
 * @copyright Alessandro Cosentino 2012
11
 * @copyright Bernhard Posselt 2012, 2014
12
 */
13
14
namespace OCA\News\Cron;
15
16
use OCA\News\AppInfo\Application;
17
use OCA\News\Config\Config;
18
use OCA\News\Service\StatusService;
19
use OCA\News\Utility\Updater as UpdaterService;
20
21
class Updater {
22
23
    public static function run() {
24
        $app = new Application();
25
26
        $container = $app->getContainer();
27
28
        // make it possible to turn off cron updates if you use an external
29
        // script to execute updates in parallel
30
        $useCronUpdates = $container->query(Config::class)->getUseCronUpdates();
31
        $isProperlyConfigured = $container->query(StatusService::class)->isProperlyConfigured();
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 80 characters; contains 96 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
32
        if ($useCronUpdates && $isProperlyConfigured) {
33
            $container->query(UpdaterService::class)->update();
34
            $container->query(UpdaterService::class)->beforeUpdate();
35
            $container->query(UpdaterService::class)->afterUpdate();
36
        }
37
    }
38
39
}
40