Completed
Push — master ( 5a29a0...22ab66 )
by Dmitry
10:00
created

PackageUpdateCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 4
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 12 2
1
<?php
2
3
namespace hiqdev\assetpackagist\commands;
4
5
use Yii;
6
7
/**
8
 * Class PackageUpdateCommand runs package update command and creates tasks to
9
 * fetch its dependencies.
10
 *
11
 * @package hiqdev\assetpackagist\commands
12
 */
13
class PackageUpdateCommand extends AbstractPackageCommand
14
{
15
    public function run()
16
    {
17
        $this->beforeRun();
18
19
        if ($this->package->canBeUpdated()) {
20
            $this->package->update();
21
        }
22
23
        Yii::$app->queue->push('package', new CollectDependenciesCommand($this->package));
24
25
        $this->afterRun();
26
    }
27
}
28