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

PackageUpdateCommand::run()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 6
nc 2
nop 0
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